Skip to content

Irreversible data migrations have no-op down() — migration:revert silently does nothing #1207

Description

@RUKAYAT-CODER

These migrations deliberately wipe/transform data and their down() is a no-op:

  • 1783000000000-clear-plaintext-auth-tokens.ts
  • 1783000000001-reencrypt-oauth-provider-tokens.ts
  • 1783000000003-clear-legacy-bcrypt-refresh-tokens.ts
  • 1600000000000-enable-uuid-ossp.ts (extension only)

pnpm run migration:revert will report "reverted successfully" while actually doing nothing for these, which is easy to misread in CI or an incident. The no-op down is documented in code comments but not enforced anywhere.

Fix: at minimum, log a loud warning in down() (like fix-invoice-number-sequence does) so revert output is honest; consider a documented list of non-reversible migrations in the migrations README.

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