CREATE TABLE IF NOT EXISTS questions (
  id                  UUID PRIMARY KEY,
  assigned_user_id    TEXT NOT NULL REFERENCES users (firebase_uid) ON DELETE CASCADE,
  question_text       TEXT NOT NULL,
  user_response       NUMERIC,
  correct_answer      NUMERIC NOT NULL,
  created_at          TIMESTAMPTZ NOT NULL DEFAULT now(),
  modified_at         TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX IF NOT EXISTS questions_assigned_user_id_idx ON questions (assigned_user_id);

CREATE INDEX IF NOT EXISTS questions_created_at_idx ON questions (created_at);
