CREATE TABLE IF NOT EXISTS tokens (
  uuid UUID PRIMARY KEY,
  description TEXT NOT NULL,
  token_hash TEXT NOT NULL,
  user_id UUID NOT NULL,
  scopes JSONB NOT NULL DEFAULT '[]',
  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  generated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  last_used_at TIMESTAMPTZ,
  revoked_at TIMESTAMPTZ,
  expires_at TIMESTAMPTZ
);
