You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
896 B
SQL
16 lines
896 B
SQL
-- Create the user settings table.
|
|
-- Each user has at most one settings row (user_id is the PK).
|
|
-- Default values match the original AI Weekly Synth defaults.
|
|
|
|
CREATE TABLE settings (
|
|
user_id UUID PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
|
|
theme TEXT NOT NULL DEFAULT 'Intelligence Artificielle',
|
|
max_age_days INTEGER NOT NULL DEFAULT 7
|
|
CHECK (max_age_days BETWEEN 1 AND 365),
|
|
categories JSONB NOT NULL DEFAULT '["Annonces majeures", "Recherche et innovation", "Industrie et entreprises", "Secteur public", "Opinions et analyses"]'::jsonb,
|
|
max_items_per_category INTEGER NOT NULL DEFAULT 4
|
|
CHECK (max_items_per_category BETWEEN 1 AND 50),
|
|
search_agent_behavior TEXT NOT NULL DEFAULT '',
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|