CREATE TABLE IF NOT EXISTS Players (
  username TEXT PRIMARY KEY,
  email TEXT UNIQUE,
  digest BLOB,
  data BLOB,
  activation_code TEXT,
  new_pass_code TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS SignedInUsers (
  code TEXT PRIMARY KEY,
  player TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  last_used_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (player) REFERENCES Players (username) ON DELETE CASCADE
);
