From 40a0f3235a6bddad3c48069681ffd34d745d8af0 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Sun, 7 Jun 2026 17:28:48 -0600 Subject: [PATCH] Update to DB --- server/db/migrations/004_cards_category.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 server/db/migrations/004_cards_category.sql diff --git a/server/db/migrations/004_cards_category.sql b/server/db/migrations/004_cards_category.sql new file mode 100644 index 0000000..c9a5edc --- /dev/null +++ b/server/db/migrations/004_cards_category.sql @@ -0,0 +1,17 @@ +-- Extend the games.category CHECK constraint to include 'cards'. +-- SQLite requires table recreation to change a CHECK constraint. + +CREATE TABLE games_new ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + slug TEXT NOT NULL UNIQUE, + name TEXT NOT NULL, + category TEXT NOT NULL CHECK (category IN ('tabletop', 'casino', 'word', 'cards')), + max_players INTEGER NOT NULL DEFAULT 2, + supports_multiplayer INTEGER NOT NULL DEFAULT 1 +); + +INSERT INTO games_new SELECT * FROM games; + +DROP TABLE games; + +ALTER TABLE games_new RENAME TO games;