You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"created_at"timestamp with time zone DEFAULT now(),
31
+
"updated_at"timestamp with time zone DEFAULT now()
32
+
);
33
+
--> statement-breakpoint
34
+
DO $$ BEGIN
35
+
ALTERTABLE"media" ADD CONSTRAINT"media_team_id_teams_id_fk"FOREIGN KEY ("team_id") REFERENCES"public"."teams"("id") ON DELETE cascadeONUPDATE no action;
36
+
EXCEPTION
37
+
WHEN duplicate_object THEN null;
38
+
END $$;
39
+
--> statement-breakpoint
40
+
DO $$ BEGIN
41
+
ALTERTABLE"media_references" ADD CONSTRAINT"media_references_team_id_teams_id_fk"FOREIGN KEY ("team_id") REFERENCES"public"."teams"("id") ON DELETE cascadeONUPDATE no action;
42
+
EXCEPTION
43
+
WHEN duplicate_object THEN null;
44
+
END $$;
45
+
--> statement-breakpoint
46
+
DO $$ BEGIN
47
+
ALTERTABLE"media_references" ADD CONSTRAINT"media_references_media_id_media_id_fk"FOREIGN KEY ("media_id") REFERENCES"public"."media"("id") ON DELETE cascadeONUPDATE no action;
48
+
EXCEPTION
49
+
WHEN duplicate_object THEN null;
50
+
END $$;
51
+
--> statement-breakpoint
52
+
CREATEUNIQUE INDEXIF NOT EXISTS "media_team_id_media_lit_id_idx"ON"media" USING btree ("team_id","media_lit_id");--> statement-breakpoint
53
+
CREATEINDEXIF NOT EXISTS "media_team_id_created_at_idx"ON"media" USING btree ("team_id","created_at");--> statement-breakpoint
54
+
CREATEINDEXIF NOT EXISTS "media_references_resource_idx"ON"media_references" USING btree ("team_id","resource_type","resource_internal_id");--> statement-breakpoint
55
+
CREATEINDEXIF NOT EXISTS "media_references_media_id_idx"ON"media_references" USING btree ("media_id");--> statement-breakpoint
56
+
CREATEUNIQUE INDEXIF NOT EXISTS "media_references_resource_media_idx"ON"media_references" USING btree ("team_id","resource_type","resource_internal_id","media_id");
0 commit comments