| 1 | CREATE TABLE "repository_language_index" ( |
| 2 | "repositoryId" text NOT NULL, |
| 3 | "ref" text NOT NULL, |
| 4 | "indexedCommitSha" text NOT NULL, |
| 5 | "updatedAt" timestamp with time zone DEFAULT now() NOT NULL, |
| 6 | CONSTRAINT "repository_language_index_repositoryId_ref_pk" PRIMARY KEY("repositoryId","ref") |
| 7 | ); |
| 8 | --> statement-breakpoint |
| 9 | CREATE TABLE "repository_language_stat" ( |
| 10 | "repositoryId" text NOT NULL, |
| 11 | "ref" text NOT NULL, |
| 12 | "language" text NOT NULL, |
| 13 | "bytes" bigint NOT NULL, |
| 14 | CONSTRAINT "repository_language_stat_repositoryId_ref_language_pk" PRIMARY KEY("repositoryId","ref","language") |
| 15 | ); |
| 16 | --> statement-breakpoint |
| 17 | ALTER TABLE "repository_language_index" ADD CONSTRAINT "repository_language_index_repositoryId_repository_id_fk" FOREIGN KEY ("repositoryId") REFERENCES "public"."repository"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint |
| 18 | ALTER TABLE "repository_language_stat" ADD CONSTRAINT "repository_language_stat_repositoryId_repository_id_fk" FOREIGN KEY ("repositoryId") REFERENCES "public"."repository"("id") ON DELETE cascade ON UPDATE no action; |