Update to DB

This commit is contained in:
Brian Fertig 2026-06-07 17:28:48 -06:00
parent 1a7dcfe9a3
commit 40a0f3235a
1 changed files with 17 additions and 0 deletions

View File

@ -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;