Merge branch 'master' into cab_compliant

This commit is contained in:
Hossein Shafagh 2020-10-16 08:33:04 -07:00 committed by GitHub
commit ab91d58a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -20,8 +20,9 @@ fileConfig(config.config_file_name)
# target_metadata = mymodel.Base.metadata # target_metadata = mymodel.Base.metadata
from flask import current_app from flask import current_app
db_url_escaped = current_app.config.get('SQLALCHEMY_DATABASE_URI').replace('%', '%%')
config.set_main_option( config.set_main_option(
"sqlalchemy.url", current_app.config.get("SQLALCHEMY_DATABASE_URI") "sqlalchemy.url", db_url_escaped
) )
target_metadata = current_app.extensions["migrate"].db.metadata target_metadata = current_app.extensions["migrate"].db.metadata