feat(artifact) : add tier-list conditions
CI / Build immutable images and deploy (push) Successful in 6m36s
CI / Build immutable images and deploy (push) Successful in 6m36s
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
CREATE TABLE "guides"."artifact_condition" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"guide_id" uuid NOT NULL,
|
||||
"name" varchar(120),
|
||||
"note" text,
|
||||
"sort_order" integer DEFAULT 0 NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
INSERT INTO "guides"."artifact_condition" ("guide_id", "sort_order")
|
||||
SELECT DISTINCT "guide_id", 0 FROM "guides"."artifact_group";
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_group" DROP CONSTRAINT "artifact_group_guide_id_guide_id_fk";
|
||||
--> statement-breakpoint
|
||||
DROP INDEX "guides"."artifact_group_order_idx";--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_group" ADD COLUMN "condition_id" uuid;--> statement-breakpoint
|
||||
UPDATE "guides"."artifact_group" AS "artifact_group"
|
||||
SET "condition_id" = "artifact_condition"."id"
|
||||
FROM "guides"."artifact_condition" AS "artifact_condition"
|
||||
WHERE "artifact_condition"."guide_id" = "artifact_group"."guide_id";
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_group" ALTER COLUMN "condition_id" SET NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_condition" ADD CONSTRAINT "artifact_condition_guide_id_guide_id_fk" FOREIGN KEY ("guide_id") REFERENCES "guides"."guide"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "artifact_condition_order_idx" ON "guides"."artifact_condition" USING btree ("guide_id","sort_order");--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_group" ADD CONSTRAINT "artifact_group_condition_id_artifact_condition_id_fk" FOREIGN KEY ("condition_id") REFERENCES "guides"."artifact_condition"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "artifact_group_order_idx" ON "guides"."artifact_group" USING btree ("condition_id","sort_order");--> statement-breakpoint
|
||||
ALTER TABLE "guides"."artifact_group" DROP COLUMN "guide_id";
|
||||
File diff suppressed because it is too large
Load Diff
@@ -316,6 +316,13 @@
|
||||
"when": 1789283972474,
|
||||
"tag": "0044_plain_mystique",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 45,
|
||||
"version": "7",
|
||||
"when": 1789637567192,
|
||||
"tag": "0045_simple_argent",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user