1
Fork 0
holycow/holycow_backend/migrations/2024-11-27-175800_first/up.sql
2024-11-28 09:36:45 +01:00

11 lines
251 B
SQL

CREATE TABLE games (
id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
p1 BPCHAR,
p2 BPCHAR,
p1result BPCHAR,
CONSTRAINT not_self CHECK (p1 != p2),
CONSTRAINT acceptable_result CHECK (p1result = 'W' OR p1result = 'T' OR p1result = 'L')
);