Ejemplo n.º 1
0
def setup_database(application):
    application.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    application.config['SQLALCHEMY_POOL_RECYCLE'] = 60
    application.config['SQLALCHEMY_DATABASE_URI'] = get_database_uri(application)

    with application.app_context():
        db.init_app(application)
        db.create_all()
        check_database()
Ejemplo n.º 2
0
def setup_database(application):
    application.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
    application.config['SQLALCHEMY_DATABASE_URI'] = get_database_uri(
        application)
    application.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
        'pool_recycle': 60,
    }

    with application.app_context():
        db.init_app(application)
        db.create_all()
        check_database()