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

Creating two migrations at the same time #707

Open
0legovich opened this issue Feb 29, 2024 · 1 comment · May be fixed by #708
Open

Creating two migrations at the same time #707

0legovich opened this issue Feb 29, 2024 · 1 comment · May be fixed by #708
Labels

Comments

@0legovich
Copy link

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:

➜  goose create test
2024/02/29 16:39:34 Created new file: 20240229133934_test.go
➜  goose create test
2024/02/29 16:39:34 goose run: failed to create migration file: %!w(<nil>)

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.

@0legovich 0legovich linked a pull request Feb 29, 2024 that will close this issue
@mfridman
Copy link
Collaborator

mfridman commented Mar 1, 2024

To be honest with the user, I think it is necessary to return an error indicating that such a file already exists.

Good catch, we should certainly expose a better error like "file already exists".

@mfridman mfridman added the bug label Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants