fix(guides) : make ordering predictable
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
WITH ranked_guides AS (
|
||||
SELECT "id", (row_number() OVER (ORDER BY "created_at", "id") * 10)::integer AS "sort_order"
|
||||
FROM "guides"."guide"
|
||||
)
|
||||
UPDATE "guides"."guide" AS "guide"
|
||||
SET "sort_order" = ranked_guides."sort_order"
|
||||
FROM ranked_guides
|
||||
WHERE "guide"."id" = ranked_guides."id";
|
||||
Reference in New Issue
Block a user