| 1 | CREATE TYPE "public"."repository_import_status" AS ENUM('pending', 'running', 'succeeded', 'failed');--> statement-breakpoint |
| 2 | CREATE TABLE "repository_import" ( |
| 3 | "id" text PRIMARY KEY |
| 4 | "repository_id" text NOT NULL |
| 5 | "requested_by_id" text NOT NULL |
| 6 | "source" text NOT NULL |
| 7 | "status" "repository_import_status" DEFAULT |
| 8 | "attempts" integer DEFAULT |
| 9 | "next_attempt_at" timestamp with time zone DEFAULT |
| 10 | "lease_until" timestamp with time zone DEFAULT |
| 11 | "claim_token" uuid DEFAULT gen_random_uuid() |
| 12 | "api_key_id" text, |
| 13 | "last_error" text, |
| 14 | "created_at" timestamp with time zone DEFAULT |
| 15 | "updated_at" timestamp with time zone DEFAULT |
| 16 | CONSTRAINT "repository_import_repositoryId_unique" UNIQUE |
| 17 | ); |
| 18 | --> statement-breakpoint |
| 19 | ALTER TABLE "repository_import" ADD |
| 20 | ALTER TABLE "repository_import" ADD |
| 21 | CREATE INDEX "repository_import_active_idx" ON |