-- Recreate server management sessions table
-- Previous migration 012 dropped this table when recommendation feature was removed
-- Now recreated for premium VM management agent (no recommendation, management only)

CREATE TABLE IF NOT EXISTS server_sessions (
  user_id TEXT PRIMARY KEY,
  status TEXT NOT NULL DEFAULT 'idle',
  collected_info TEXT NOT NULL DEFAULT '{}',
  messages TEXT NOT NULL DEFAULT '[]',
  created_at INTEGER NOT NULL,
  updated_at INTEGER NOT NULL,
  expires_at INTEGER NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_server_sessions_expires ON server_sessions(expires_at);
