Skip to content

fix-forum-anonymous-author down() isn't cleanly reversible #1208

Description

@RUKAYAT-CODER

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions