1
0

schema.sql 428 B

1234567891011121314
  1. CREATE TABLE IF NOT EXISTS users (
  2. id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  3. email text UNIQUE NOT NULL,
  4. password text NOT NULL
  5. );
  6. CREATE TABLE IF NOT EXISTS matches (
  7. id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  8. player1_id uuid NOT NULL REFERENCES users,
  9. player2_id uuid NOT NULL REFERENCES users,
  10. player1_score int NOT NULL,
  11. player2_score int NOT NULL,
  12. player1_won bool NOT NULL
  13. );