radical-chess/migrations/0001_init.sql
maverick 4f2676df1e Radical Chess — real-time online chess on Cloudflare
Play by shareable link, vs the Radical Bot, or pass-and-play. Server-authoritative
moves (chess.js) in a per-game Durable Object, clocks with idle flag-fall via DO
alarms, draw/resign/rematch/chat, D1 game archive, custom board UI (drag + click).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 21:29:02 +10:00

15 lines
532 B
SQL

-- Finished-game archive + lightweight stats
CREATE TABLE IF NOT EXISTS games (
id TEXT PRIMARY KEY,
white_name TEXT,
black_name TEXT,
result TEXT, -- '1-0', '0-1', '1/2-1/2', '*'
reason TEXT, -- checkmate, resign, timeout, draw, stalemate...
pgn TEXT,
moves INTEGER DEFAULT 0,
time_control TEXT, -- e.g. '300+3' or 'unlimited'
created_at INTEGER,
ended_at INTEGER
);
CREATE INDEX IF NOT EXISTS idx_games_created ON games(created_at DESC);