Exemplo n.º 1
0
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata

import os, sys
#补充路径
#这是到Luyasi-Flask/dxc
sys.path.append(os.getcwd())
#这是到Luyasi-flask
sys.path.append(os.path.dirname(os.getcwd()))

from dxc.app.api import create_app
from dxc import setting
from flaskframe.core import db

app = create_app(settings_override=setting)
config.set_main_option("sqlalchemy.url", app.config['SQLALCHEMY_DATABASE_URI'])

target_metadata = db.metadata

# compare column type
# context.configure(compare_type=True)

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.

def run_migrations_offline():
    """Run migrations in 'offline' mode.
Exemplo n.º 2
0
 def create_app(self):
     #这个要是写在最前面会和test下的front混在一起。。		
     app = api.create_app(settings_override=test_setting)
     app.config['TESTING'] = True
     return app