CREATE TABLE users (
  id            BIGSERIAL PRIMARY KEY,
  name          text      NOT NULL,
  email         text      NOT NULL UNIQUE,
  password_hash text      NOT NULL,
  bio           text
);

CREATE TABLE platform (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL
);

CREATE TABLE game (
  id           BIGSERIAL PRIMARY KEY,
  name         text      NOT NULL,
  platform_id  BIGINT    NOT NULL REFERENCES platform(id),
  score        INT       NOT NULL,
  release_year DATE      NOT NULL,
  finished     DATE
);
