1791000000001-fix-forum-anonymous-author.ts:
down() drops FK_forum_votes_authorId_users by name — but that name only exists if the FK was created with it; on dev synchronize-created or baseline schemas the FK may have a different name, making DROP CONSTRAINT IF EXISTS a silent no-op
up()/down() purge/alter forum_votes and flag-state changes that can't be reconstructed
This matters now that migration:run/migration:revert run from scratch in CI (#1193): the revert step must not leave the DB in a broken state.
Fix: make down() resolve the FK by querying pg_constraint (not by hard-coded name), and document the irreversible parts.
1791000000001-fix-forum-anonymous-author.ts:down()dropsFK_forum_votes_authorId_usersby name — but that name only exists if the FK was created with it; on devsynchronize-created or baseline schemas the FK may have a different name, makingDROP CONSTRAINT IF EXISTSa silent no-opup()/down()purge/alterforum_votesand flag-state changes that can't be reconstructedThis matters now that
migration:run/migration:revertrun from scratch in CI (#1193): the revert step must not leave the DB in a broken state.Fix: make
down()resolve the FK by queryingpg_constraint(not by hard-coded name), and document the irreversible parts.