feat : big update
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
ALTER TABLE "catalog"."catalog_character" ADD COLUMN "talents" jsonb DEFAULT '[]'::jsonb NOT NULL;--> statement-breakpoint
|
||||
WITH ranked_groups AS (
|
||||
SELECT "id", row_number() OVER (PARTITION BY "guide_id" ORDER BY "sort_order", "id") AS "position"
|
||||
FROM "guides"."artifact_group"
|
||||
)
|
||||
DELETE FROM "guides"."artifact_group"
|
||||
WHERE "id" IN (SELECT "id" FROM ranked_groups WHERE "position" > 2);--> statement-breakpoint
|
||||
WITH ranked_groups AS (
|
||||
SELECT "id", row_number() OVER (PARTITION BY "guide_id" ORDER BY "sort_order", "id") AS "position"
|
||||
FROM "guides"."artifact_group"
|
||||
)
|
||||
UPDATE "guides"."artifact_group" AS artifact_group
|
||||
SET "name" = CASE ranked_groups."position" WHEN 1 THEN 'Late Game' ELSE 'Early Game' END,
|
||||
"sort_order" = ranked_groups."position" - 1
|
||||
FROM ranked_groups
|
||||
WHERE artifact_group."id" = ranked_groups."id";--> statement-breakpoint
|
||||
INSERT INTO "guides"."artifact_group" ("guide_id", "name", "sort_order")
|
||||
SELECT guide."id", 'Late Game', 0
|
||||
FROM "guides"."guide" AS guide
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM "guides"."artifact_group" AS artifact_group
|
||||
WHERE artifact_group."guide_id" = guide."id" AND artifact_group."sort_order" = 0
|
||||
);--> statement-breakpoint
|
||||
INSERT INTO "guides"."artifact_group" ("guide_id", "name", "sort_order")
|
||||
SELECT guide."id", 'Early Game', 1
|
||||
FROM "guides"."guide" AS guide
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM "guides"."artifact_group" AS artifact_group
|
||||
WHERE artifact_group."guide_id" = guide."id" AND artifact_group."sort_order" = 1
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -50,6 +50,13 @@
|
||||
"when": 1788070114887,
|
||||
"tag": "0006_overconfident_drax",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 7,
|
||||
"version": "7",
|
||||
"when": 1788086585687,
|
||||
"tag": "0007_catalog_talents_fixed_artifact_groups",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user