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
631 B
Python
21 lines
631 B
Python
5 years ago
|
"""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 gears_api.index import create_app
|
||
|
from gears_api.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)()
|