Migrations Required
Never edit an applied migration
Once a migration has run anywhere outside your own machine, never change it. Fix mistakes with a new migration.
How to do it
Many tools store a checksum of each applied file and refuse to run when it changes. Treat that error as a warning about history, not as something to switch off.
Example
# CI step: prints nothing and passes when only new migrations were added
test -z "$(git diff --name-only --diff-filter=MDR origin/main...HEAD -- migrations/)"
How to check
The migration tool's checksum validation is on. CI also fails when a pull request changes or deletes a migration file that exists on the main branch.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/migrations/immutable-migrations.