-- cleanup-settings-tables.sql
-- Drop unnecessary columns from settings tables to align with the refined architecture.

-- 1. Prune user_settings table
-- Keeps only id, userId, and language.
ALTER TABLE user_settings DROP COLUMN selectedLLMId;
ALTER TABLE user_settings DROP COLUMN selectedEmbeddingId;
ALTER TABLE user_settings DROP COLUMN selectedRerankId;
ALTER TABLE user_settings DROP COLUMN temperature;
ALTER TABLE user_settings DROP COLUMN maxTokens;
ALTER TABLE user_settings DROP COLUMN enableRerank;
ALTER TABLE user_settings DROP COLUMN topK;
ALTER TABLE user_settings DROP COLUMN similarityThreshold;
ALTER TABLE user_settings DROP COLUMN enableFullTextSearch;
ALTER TABLE user_settings DROP COLUMN defaultVisionModelId;
ALTER TABLE user_settings DROP COLUMN coachKbId;
ALTER TABLE user_settings DROP COLUMN created_at;
ALTER TABLE user_settings DROP COLUMN updated_at;
ALTER TABLE user_settings DROP COLUMN rerankSimilarityThreshold;
ALTER TABLE user_settings DROP COLUMN hybridVectorWeight;
ALTER TABLE user_settings DROP COLUMN isGlobal;
ALTER TABLE user_settings DROP COLUMN enableQueryExpansion;
ALTER TABLE user_settings DROP COLUMN enableHyDE;
ALTER TABLE user_settings DROP COLUMN chunkSize;
ALTER TABLE user_settings DROP COLUMN chunkOverlap;

-- 2. Prune tenant_settings table
-- Language is now strictly a user-level setting.
ALTER TABLE tenant_settings DROP COLUMN language;
