fix: reapply exercise updated_by backfill

This commit is contained in:
Erza Bytyci
2026-06-08 00:51:42 +00:00
parent a63bb71017
commit c7493cf08d
3 changed files with 46 additions and 2 deletions
@@ -0,0 +1,37 @@
-- Re-apply exercise updated_by backfill in a new migration.
-- This is intentionally idempotent and safe to run multiple times.
-- It addresses environments where earlier backfill migration content differed
-- but migration version 00052 is already marked as applied.
UPDATE exercises
SET updated_by = created_by
WHERE updated_by IS NULL
AND created_by IS NOT NULL;
UPDATE exercises e
SET updated_by = de.created_by
FROM dnd_exercises de
WHERE e.id = de.exercise_id
AND e.updated_by IS NULL
AND de.created_by IS NOT NULL;
UPDATE exercises e
SET updated_by = dme.created_by
FROM dnd_match_exercises dme
WHERE e.id = dme.exercise_id
AND e.updated_by IS NULL
AND dme.created_by IS NOT NULL;
UPDATE exercises e
SET updated_by = mge.created_by
FROM memory_game_exercises mge
WHERE e.id = mge.exercise_id
AND e.updated_by IS NULL
AND mge.created_by IS NOT NULL;
UPDATE exercises e
SET updated_by = jse.created_by
FROM jumbled_sentence_exercises jse
WHERE e.id = jse.exercise_id
AND e.updated_by IS NULL
AND jse.created_by IS NOT NULL;
File diff suppressed because one or more lines are too long
+8 -1
View File
@@ -1,4 +1,11 @@
{
"status": "failed",
"failedTests": []
"failedTests": [
"18e1443b7169cebccd21-4a0da125f055d790cf05",
"cf4ffee829137744e3cd-e6406448e73a28c0ddd9",
"d936625e1207b3e19d4b-67eb4c2dd9e8efb88e3d",
"d8918302922cfb4b5ab2-53975d1f9ee0854667fa",
"d8918302922cfb4b5ab2-fdd621e8f42178e15eb4",
"d8918302922cfb4b5ab2-ae27decdc4c0ad5570ee"
]
}