Refactor backend database connection, migration, seed

This commit is contained in:
2025-10-17 12:41:58 +02:00
parent 176032e54b
commit 560693633e
9 changed files with 163 additions and 99 deletions

View File

@@ -0,0 +1,17 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE IF NOT EXISTS selections (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
main TEXT NOT NULL,
side TEXT NOT NULL,
soup TEXT,
created_at TEXT NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id)
)
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS selections;
-- +goose StatementEnd