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

Error when no migration files are found #336

Closed
mfridman opened this issue Apr 23, 2022 · 2 comments
Closed

Error when no migration files are found #336

mfridman opened this issue Apr 23, 2022 · 2 comments

Comments

@mfridman
Copy link
Collaborator

If the -dir flag is unset, the default goose behaviour is to default to the current directory . This behaviour is confusing, and usually (I think) the result of user error.

As an example, if I run a goose command such as down, up, status, etc. and accidentally forget to set the -dir flag (default to .) then goose will happily run the command and the output can be a bit misleading:

goose: no migrations to run. current version: 11

Little does the user know that no files were actually found.

I think we should improve this behaviour. Either check the current dir is . and error if no .sql or .go files are found, or do this universally for any directory where no .sql or .go files are found.

@VojtechVitek
Copy link
Collaborator

I agree, good idea 👍 Let's be more strict to prevent user errors.

@mfridman
Copy link
Collaborator Author

Fixed by #539

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

Successfully merging a pull request may close this issue.

2 participants