Ejemplo n.º 1
0
from logging.config import fileConfig

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
from vircu.models import db
from vircu.application import create_app

app = create_app(False)
target_metadata = db.Model.metadata

# more config
config.set_section_option('alembic', 'sqlalchemy.url', app.config['SQLALCHEMY_DATABASE_URI'])

def run_migrations_offline():
    """Run migrations in 'offline' mode.

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation
    we don't even need a DBAPI to be available.

    Calls to context.execute() here emit the given string to the
    script output.
Ejemplo n.º 2
0
from vircu.application import create_app

app = create_app()