This commit is contained in:
nora 2025-07-12 21:38:06 +02:00
commit 1772e21364
13 changed files with 2961 additions and 0 deletions

View file

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT, -- ensure no IDs are reused
username TEXT NOT NULL UNIQUE,
password TEXT NOT NULL
);
CREATE INDEX users_username ON users(username);

View file

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS sessions (
session_id TEXT NOT NULL PRIMARY KEY,
user_id INTEGER NOT NULL,
created INTEGER NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) STRICT;