tkr/config/migrations/001_init.sql
Greg Sarjeant 4255f46fc7
Some checks failed
Run unit tests / run-unit-tests (push) Has been cancelled
Fix database migrations for first-time setup. (#29)
The database initialization had a number of bugs for the first-time setup. This PR fixes them.

Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/29
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-07-26 15:46:06 +00:00

32 lines
767 B
SQL

CREATE TABLE IF NOT EXISTS user (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL,
display_name TEXT NOT NULL,
password_hash TEXT NULL,
about TEXT NULL,
website TEXT NULL,
mood TEXT NULL
);
CREATE TABLE IF NOT EXISTS settings (
id INTEGER PRIMARY KEY,
site_title TEXT NOT NULL,
site_description TEXT NULL,
base_url TEXT NOT NULL,
base_path TEXT NOT NULL,
items_per_page INTEGER NOT NULL,
css_id INTEGER NULL,
strict_accessibility BOOLEAN DEFAULT TRUE
);
CREATE TABLE IF NOT EXISTS css (
id INTEGER PRIMARY KEY,
filename TEXT UNIQUE NOT NULL,
description TEXT NULL
);
CREATE TABLE IF NOT EXISTS emoji(
id INTEGER PRIMARY KEY,
emoji TEXT UNIQUE NOT NULL,
description TEXT NOT NULL
);