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

Allow to init_app correctly without specifying db. #118

Merged
merged 1 commit into from
Jul 10, 2016

Conversation

vakimov
Copy link
Contributor

@vakimov vakimov commented Jul 10, 2016

When using app factory like this:

db = SQLAlchemy()
migrate = Migrate(db=db)

def create_app():
    pp = Flask(__name__)
    db.init_app(app)
    migrate.init_app(app)

I've go the next error:

...
  File "migrations/env.py", line 23, in <module>
    target_metadata = current_app.extensions['migrate'].db.metadata
AttributeError: 'NoneType' object has no attribute 'metadata'

@miguelgrinberg miguelgrinberg merged commit db82f67 into miguelgrinberg:master Jul 10, 2016
@miguelgrinberg
Copy link
Owner

Looks good. Thanks!

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 this pull request may close these issues.

2 participants