Files
2026-06-28 15:09:09 +02:00

13 lines
541 B
SQL

PRAGMA foreign_keys = ON;
-- Demo "hello world" persistence: a single editable message that shows the full
-- loop (sign in -> read from the DB -> write back -> see who last changed it).
-- Singleton row, always id = 1. Safe to delete this table and its functions
-- (get-message / update-message) once you start building your own thing.
CREATE TABLE IF NOT EXISTS message_state (
id INTEGER PRIMARY KEY,
message TEXT NOT NULL,
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_by_user_id TEXT REFERENCES "user" ("id")
);