-- system_config: global key-value store for runtime admin configuration
CREATE TABLE IF NOT EXISTS "system_config" (
  "key"        text PRIMARY KEY,
  "value"      text NOT NULL,
  "updated_at" timestamp with time zone NOT NULL DEFAULT now(),
  "updated_by" text
);

-- Seed the default LLM model so the setting is present from first deploy
INSERT INTO "system_config" ("key", "value", "updated_by")
VALUES ('llm_model', 'gemini-3-flash-preview', 'system')
ON CONFLICT ("key") DO NOTHING;
