Exemplo n.º 1
0
# 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 myapp import mymodel
# target_metadata = mymodel.Base.metadata

md = ConfigManager()
md.load_db_config(cf.get_db_config())

connect_string = md.get_connect_string()

print("======", connect_string)

config.set_main_option('sqlalchemy.url',
                       connect_string)
target_metadata = base_model.BaseModel.metadata


# 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():