Skip to content

Why can't I use atlas migrate diff to generate a new migration file after using the atlas migrate apply command? #1995

Closed Answered by a8m
rehth asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @rehth 👋

The concept of the dev-database is explained here: https://atlasgo.io/atlas-schema/sql#dev-database. In short, you cannot use the same database for both apply and diff. The first represents the "real" database (or is the actual one), while the second is used in development to validate the migration directory and compute the new SQL diff.

As mentioned above, Atlas uses the dev database to compute the desired state of the database schema. Therefore, before starting its work, Atlas ensures the dev database is clean and there are no leftovers from previous runs. Once done, Atlas cleans up after itself and the dev database is ready for future runs.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rehth
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