feat: setup goose and database module

This commit is contained in:
2026-05-13 10:29:34 +02:00
parent 8ba3926a11
commit 2167955bb2
18 changed files with 350 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
PRAGMA foreign_keys = OFF;
BEGIN TRANSACTION;
CREATE TABLE user_new (
id TEXT PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
password_hash TEXT NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO user_new (id, username, password_hash, created_at)
SELECT id, username, password_hash, created_at
FROM user;
DROP TABLE user;
ALTER TABLE user_new RENAME TO user;
COMMIT;
PRAGMA foreign_keys = ON;