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

Unclear error messages from alembic when base cannot find 'migrations' directory. #663

Closed
novafacing opened this issue Feb 24, 2020 · 7 comments

Comments

@novafacing
Copy link
Contributor

@novafacing novafacing commented Feb 24, 2020

I have a pull request ready to fix this.

It's a very simple issue, when I run some flask stuff from the wrong directory, calling upgrade() in flask_migrate tries to use alembic to obtain the 'migrations' directory. Unfortunately the error message when it cannot find 'migrate' is pretty unclear if it ends up printing a relative path (in my case the path was simply '.') you'll see an error message like:

alembic.util.exc.CommandError: Path doesn't exist: 'migrations'. Please use the 'init' command to create a new scripts folder.

novafacing added a commit to novafacing/alembic that referenced this issue Feb 24, 2020
@sqla-tester

This comment has been minimized.

Copy link
Collaborator

@sqla-tester sqla-tester commented Feb 24, 2020

Rowan Hart has proposed a fix for this issue in the master branch:

Fixes #663. Clarified an error message on failure to find 'migrations' path. https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/1740

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Feb 24, 2020

yeah "migrations" is not a "path" exactly is it

@novafacing

This comment has been minimized.

Copy link
Contributor Author

@novafacing novafacing commented Feb 24, 2020

It should be a path, I haven’t seen any options for the dir. argument to that function to be a URI or anything different

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Feb 24, 2020

there's a way it can be a setuptools resource path I think and also someone wants to make the whole thing work without filesystems at all but that's not happening right now.

@novafacing

This comment has been minimized.

Copy link
Contributor Author

@novafacing novafacing commented Feb 24, 2020

Ah gotcha, I hadn't noticed that. Making it all work with no fs sounds like quite an undertaking but also a pretty cool idea!

@sqla-tester

This comment has been minimized.

Copy link
Collaborator

@sqla-tester sqla-tester commented Feb 25, 2020

Rowan Hart has proposed a fix for this issue in the master branch:

Clarified an error message on failure to find 'migrations' path. https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/1740

@zzzeek

This comment has been minimized.

Copy link
Member

@zzzeek zzzeek commented Feb 25, 2020

thanks!

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.