Skip to content

Creating two migrations at the same time #707

@0legovich

Description

@0legovich

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions