| 1 | CREATE TABLE "repository_path_commit" ( |
| 2 | "repositoryId" text NOT NULL, |
| 3 | "ref" text NOT NULL, |
| 4 | "path" text NOT NULL, |
| 5 | "commitSha" text NOT NULL, |
| 6 | "committedAt" timestamp NOT NULL, |
| 7 | "subject" text NOT NULL, |
| 8 | CONSTRAINT "repository_path_commit_repositoryId_ref_path_pk" PRIMARY KEY("repositoryId","ref","path") |
| 9 | ); |
| 10 | --> statement-breakpoint |
| 11 | CREATE TABLE "repository_ref_index" ( |
| 12 | "repositoryId" text NOT NULL, |
| 13 | "ref" text NOT NULL, |
| 14 | "indexedCommitSha" text NOT NULL, |
| 15 | "updatedAt" timestamp DEFAULT now() NOT NULL, |
| 16 | CONSTRAINT "repository_ref_index_repositoryId_ref_pk" PRIMARY KEY("repositoryId","ref") |
| 17 | ); |
| 18 | --> statement-breakpoint |
| 19 | ALTER TABLE "repository_path_commit" ADD CONSTRAINT "repository_path_commit_repositoryId_repository_id_fk" FOREIGN KEY ("repositoryId") REFERENCES "public"."repository"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint |
| 20 | ALTER TABLE "repository_ref_index" ADD CONSTRAINT "repository_ref_index_repositoryId_repository_id_fk" FOREIGN KEY ("repositoryId") REFERENCES "public"."repository"("id") ON DELETE cascade ON UPDATE no action; |