Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More information about migration version #117

Closed
eaglemoor opened this issue Sep 27, 2018 · 2 comments
Closed

More information about migration version #117

eaglemoor opened this issue Sep 27, 2018 · 2 comments

Comments

@eaglemoor
Copy link

Now goose use version by file prefix name like 0001_, 0002_...
But this way, have one trouble. If 2+ people create migration with prefix 0003_ (0003_create_user, 0003_create_address) and try push they code to release, they catch error. Who first apply migration to staging server, before include to release brach, win. Other can't apply migration, because 0003 already exist in db.

But, if migration version have name (filename from sql file or custom name from go file) it's don't happened.

@VojtechVitek
Copy link
Collaborator

See discussion at #63. This is a known problem that many people struggle with. However, the sequential numbers are protecting you from running the migrations out of order, which may cause very bad side effects in master branch that you couldn't see or predict in the development branch.

@eaglemoor
Copy link
Author

datetime prefix is good solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants