from flask import Flask;
from configuration import Configuration;
from flask_migrate import Migrate, init, migrate, upgrade;
from models import database;
from sqlalchemy_utils import database_exists, create_database;

application = Flask(__name__);
application.config.from_object(Configuration);

migrateObject = Migrate(application, database);

done = False;

while not done:
    try:
        if not database_exists(application.config["SQLALCHEMY_DATABASE_URI"]):
            create_database(application.config["SQLALCHEMY_DATABASE_URI"]);

        database.init_app(application);

        with application.app_context() as context:
            init();
            migrate(message="Production migration");
            upgrade();
            done = True;

    except Exception as err:
        print(err);

b2ee09ba3f9dcc7ea44fe104edb43e4f866d7f07
<mask token>

<mask token>
application.config.from_object(Configuration)
<mask token>
while not done:
    try:
        if not database_exists(application.config['SQLALCHEMY_DATABASE_URI']):
            create_database(application.config['SQLALCHEMY_DATABASE_URI'])
        database.init_app(application)
        with application.app_context() as context:
            init()
            migrate(message='Production migration')
            upgrade()
            done = True
    except Exception as err:
        print(err)

<mask token>
application = Flask(__name__)
application.config.from_object(Configuration)
migrateObject = Migrate(application, database)
done = False
while not done:
    try:
        if not database_exists(application.config['SQLALCHEMY_DATABASE_URI']):
            create_database(application.config['SQLALCHEMY_DATABASE_URI'])
        database.init_app(application)
        with application.app_context() as context:
            init()
            migrate(message='Production migration')
            upgrade()
            done = True
    except Exception as err:
        print(err)

from flask import Flask
from configuration import Configuration
from flask_migrate import Migrate, init, migrate, upgrade
from models import database
from sqlalchemy_utils import database_exists, create_database
application = Flask(__name__)
application.config.from_object(Configuration)
migrateObject = Migrate(application, database)
done = False
while not done:
    try:
        if not database_exists(application.config['SQLALCHEMY_DATABASE_URI']):
            create_database(application.config['SQLALCHEMY_DATABASE_URI'])
        database.init_app(application)
        with application.app_context() as context:
            init()
            migrate(message='Production migration')
            upgrade()
            done = True
    except Exception as err:
        print(err)

from flask import Flask;
from configuration import Configuration;
from flask_migrate import Migrate, init, migrate, upgrade;
from models import database;
from sqlalchemy_utils import database_exists, create_database;

application = Flask(__name__);
application.config.from_object(Configuration);

migrateObject = Migrate(application, database);

done = False;

while not done:
    try:
        if not database_exists(application.config["SQLALCHEMY_DATABASE_URI"]):
            create_database(application.config["SQLALCHEMY_DATABASE_URI"]);

        database.init_app(application);

        with application.app_context() as context:
            init();
            migrate(message="Production migration");
            upgrade();
            done = True;

    except Exception as err:
        print(err);
