CREATE TABLE "pending_merges" (
  "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  "repo" TEXT NOT NULL,
  "pr_number" INTEGER NOT NULL,
  "head_sha" TEXT NOT NULL,
  "state" TEXT NOT NULL DEFAULT 'pending',
  "review_result" JSONB,
  "ci_status" TEXT,
  "requester" TEXT,
  "gitea_merge_url" TEXT,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  CONSTRAINT "pending_merges_repo_pr_sha_key" UNIQUE ("repo", "pr_number", "head_sha")
);
