-- Migration: Add server_info column to servers table
-- This column stores server metadata: OS info, live status, top processes, containers, IP info

DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM information_schema.columns 
        WHERE table_name = 'servers' AND column_name = 'server_info'
    ) THEN
        ALTER TABLE servers ADD COLUMN server_info JSONB;
        CREATE INDEX IF NOT EXISTS idx_servers_server_info ON servers USING GIN (server_info);
        RAISE NOTICE 'server_info column added to servers table';
    ELSE
        RAISE NOTICE 'server_info column already exists';
    END IF;
END $$;

