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.

24 lines
634 B
Python

5 years ago
"""isort:skip_file
"""
import os
5 years ago
import sys
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..")) # noqa
5 years ago
from alembic import context
from casbin_api.index import create_app
from casbin_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()
5 years ago
app.injector.get_resolver().resolve(run_migrations_online)()