Skip to content

Commit

Permalink
Merge pull request #123 from quantum-brackets/admin-resources
Browse files Browse the repository at this point in the history
Admin resources
  • Loading branch information
henzyd authored Jan 22, 2025
2 parents d98cdae + 78f9751 commit 1aa5958
Show file tree
Hide file tree
Showing 33 changed files with 3,686 additions and 347 deletions.
25 changes: 25 additions & 0 deletions migrations/0001_lying_retro_girl.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ALTER TABLE "medias" DROP CONSTRAINT "medias_user_id_users_id_fk";
--> statement-breakpoint
ALTER TABLE "medias" DROP CONSTRAINT "medias_location_id_locations_id_fk";
--> statement-breakpoint
ALTER TABLE "medias" DROP CONSTRAINT "medias_resource_id_resources_id_fk";
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "medias" ADD CONSTRAINT "medias_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "medias" ADD CONSTRAINT "medias_location_id_locations_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."locations"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "medias" ADD CONSTRAINT "medias_resource_id_resources_id_fk" FOREIGN KEY ("resource_id") REFERENCES "public"."resources"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "groups" DROP COLUMN IF EXISTS "num";
1 change: 1 addition & 0 deletions migrations/0002_demonic_forgotten_one.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "resource_groups" ADD COLUMN "num" integer NOT NULL;
Loading

0 comments on commit 1aa5958

Please sign in to comment.