Skip to content

Multiple custom constraint migrations on the same column #3354

Answered by simolus3
frankvollebregt asked this question in Q&A
Discussion options

You must be logged in to vote

This is unfortunately a fundamental problem with the default migration APIs because they're unaware of older schema versions (as the generated code can only depend on the current definitions).

We have tooling that allows you to create older schema versions too, but it's a separate CLI invocation. There is a standalone command that will export your current schema into a JSON file (I suppose you're already doing that or a similar command for tests). When you run that command again after making schema changes and incrementing the schema version, we generate helpers for the migration that are aware of the schema you're migrating too. It's hard to do that retroactively, but we have guides on u…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@frankvollebregt
Comment options

Answer selected by frankvollebregt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants