-- ═══════════════════════════════════════════════════════════════ -- 035 SITE SETTINGS -- -- What the site says about itself, editable in the admin (Panel → -- Site settings, superadmins only) instead of only in site.json. -- Every column is an override: null means "whatever site.json -- says", so a fresh database behaves exactly as before and the -- built index.html (made from site.json) stays a true fallback for -- when the API is down. -- -- site_name the site's name, in every title -- description the default search description -- preview_image the default link-preview image -- favicon the browser-tab icon ('/uploads/…', PNG or SVG) -- apple_touch_icon the home-screen icon on iPhones (PNG, 180px) -- indexing 'on' or 'off': whether search engines may list -- the site. Per database, so the dev server can -- say off while production says on, from one -- build. Null follows site.json's robots.index. -- -- site_setting_pages overrides a static page's title and intro -- (site.json's "pages"), one row per page that differs. The path -- must be one of site.json's pages; the admin only offers those. -- -- A singleton like front_page: one row, made here, which the admin -- edits and can't delete. -- -- PRAGMA user_version; -- reads 34 before this file -- ═══════════════════════════════════════════════════════════════ CREATE TABLE site_settings ( id TEXT PRIMARY KEY CHECK (id = 'site'), site_name TEXT, description TEXT, preview_image TEXT, favicon TEXT, apple_touch_icon TEXT, indexing TEXT CHECK (indexing IN ('on', 'off')), updated_at TEXT NOT NULL DEFAULT (datetime('now')) ) STRICT; INSERT INTO site_settings (id) VALUES ('site'); CREATE TABLE site_setting_pages ( id INTEGER PRIMARY KEY AUTOINCREMENT, settings_id TEXT NOT NULL REFERENCES site_settings (id) ON DELETE CASCADE, sort_order INTEGER NOT NULL DEFAULT 0, path TEXT NOT NULL, -- '/retreats' title TEXT, description TEXT, UNIQUE (settings_id, path) ) STRICT; -- ── Triggers last (see CLAUDE.md, Migrations) ── CREATE TRIGGER site_settings_touch AFTER UPDATE ON site_settings FOR EACH ROW WHEN new.updated_at = old.updated_at BEGIN UPDATE site_settings SET updated_at = datetime('now') WHERE id = new.id; END;