-
Notifications
You must be signed in to change notification settings - Fork 553
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
Creating two migrations at the same time #707
Comments
Good catch, we should certainly expose a better error like "file already exists". |
@mfridman is there any option for a version prefix other than timestamp? |
Yep, goose supports both timestamp (effectively very large numbers) and sequential numbers.
The |
@mfridman thanks! |
It's not configurable via the goose CLI (at least not today, something we might consider if there's enough demand). There is the In another project I worked on we just create a 00N.sql files with bash. Lots of options. |
When creating a migration file, goose adds a prefix in timestamp format with precision to the second. If you run the goose create command twice in a second, you will get unexpected behavior:
Error in the line https://github.com/pressly/goose/blob/master/create.go#L61
To be honest with the user, I think it is necessary to return an error indicating that such a file already exists.
The text was updated successfully, but these errors were encountered: