You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
671 B
Python
21 lines
671 B
Python
"""isort:skip_file
|
|
"""
|
|
import os
|
|
import sys; sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) # noqa
|
|
|
|
from alembic import context
|
|
from {{cookiecutter.project_slug}}.index import create_app
|
|
from {{cookiecutter.project_slug}}.db import Base
|
|
from molten.contrib.sqlalchemy import EngineData
|
|
|
|
_, app = create_app()
|
|
|
|
|
|
def run_migrations_online(engine_data: EngineData):
|
|
with engine_data.engine.connect() as connection:
|
|
context.configure(connection=connection, target_metadata=Base.metadata)
|
|
with context.begin_transaction():
|
|
context.run_migrations()
|
|
|
|
|
|
app.injector.get_resolver().resolve(run_migrations_online)() |