CREATE TABLE IF NOT EXISTS users (
  firebase_uid        TEXT PRIMARY KEY,
  email               TEXT,
  display_name        TEXT,
  photo_url           TEXT,
  locale              TEXT NOT NULL DEFAULT 'en',
  timezone            TEXT,
  onboarding_done     BOOLEAN NOT NULL DEFAULT FALSE,
  revision            BIGINT NOT NULL DEFAULT 1,
  updated_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
  created_at          TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX IF NOT EXISTS users_updated_at_idx ON users (updated_at);
