Add game start functionality with automatic player chip generation
Implemented host-controlled game start mechanism that generates unique player chips from user names. Added `started_at` timestamp to games and new `game_chips` table to store player identifiers. Chips are created using first name initial plus first two surname letters (e.g., SNE for Sascha Nesterovic) with automatic conflict resolution. Updated frontend to display start button for hosts, show game status, and populate chip selection modal
This commit is contained in:
@@ -136,6 +136,14 @@ Very small, pragmatic auto-migration (no alembic).
|
||||
except Exception:
|
||||
db.rollback()
|
||||
|
||||
# started_at: games are open for joining until the host starts them
|
||||
if not _has_column(db, "games", "started_at"):
|
||||
try:
|
||||
db.execute(text("ALTER TABLE games ADD COLUMN started_at DATETIME"))
|
||||
db.commit()
|
||||
except Exception:
|
||||
db.rollback()
|
||||
|
||||
# host_user_id (nice to have for "only host can set winner")
|
||||
if not _has_column(db, "games", "host_user_id"):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user