Closes #127. Grows user_ai_prefs with five nullable owner-default columns and makes them the server-side fallback layer: request param -> stored pref -> hard default, at insight generation (agentic + standard), all three insight-chat turn variants, and reel creation. - PUT /prefs accepts the fields with the existing three-state partial update semantics (TriState generalized to TriState<T> for the numeric reel_max_segments); validation (canonical BackendKind::parse, MemoriesSpan::from_str) runs before any write. - GET /prefs returns the new fields. - capture_prefs reads the existing row and carries the AI owner-defaults through unchanged (the upsert overwrites all columns), mirroring only the effective reel span/segments. - MemoriesSpan gains Display + FromStr so stored spans round-trip losslessly. 1463/0 tests (+27), clippy clean.
9 lines
470 B
SQL
9 lines
470 B
SQL
-- Owner defaults: recurring per-user picks that were previously re-sent on
|
|
-- every request. All nullable — NULL = keep the current per-request /
|
|
-- hard-default behavior.
|
|
ALTER TABLE user_ai_prefs ADD COLUMN default_model TEXT;
|
|
ALTER TABLE user_ai_prefs ADD COLUMN default_backend TEXT;
|
|
ALTER TABLE user_ai_prefs ADD COLUMN default_persona_id TEXT;
|
|
ALTER TABLE user_ai_prefs ADD COLUMN reel_span TEXT;
|
|
ALTER TABLE user_ai_prefs ADD COLUMN reel_max_segments INTEGER;
|