| 1 | CREATE TABLE "repository_team" ( |
| 2 | "repositoryId" text NOT NULL, |
| 3 | "teamId" text NOT NULL, |
| 4 | "role" "repository_role" NOT NULL, |
| 5 | "createdAt" timestamp with time zone DEFAULT now() NOT NULL, |
| 6 | CONSTRAINT "repository_team_repositoryId_teamId_pk" PRIMARY KEY("repositoryId","teamId") |
| 7 | ); |
| 8 | --> statement-breakpoint |
| 9 | ALTER TABLE "repository_team" ADD CONSTRAINT "repository_team_repositoryId_repository_id_fk" FOREIGN KEY ("repositoryId") REFERENCES "public"."repository"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint |
| 10 | ALTER TABLE "repository_team" ADD CONSTRAINT "repository_team_teamId_team_id_fk" FOREIGN KEY ("teamId") REFERENCES "public"."team"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint |
| 11 | CREATE INDEX "repository_team_team_idx" ON "repository_team" USING btree ("teamId"); |