mirror of
https://github.com/open-webui/computer.git
synced 2026-11-23 14:10:45 -05:00
25 lines
698 B
Python
25 lines
698 B
Python
from alembic import context
|
|
from sqlalchemy import engine_from_config, pool
|
|
|
|
from cptr.models import Base
|
|
|
|
target_metadata = Base.metadata
|
|
|
|
|
|
def run_migrations_online():
|
|
connectable = context.config.attributes.get("connection", None)
|
|
if connectable is None:
|
|
connectable = engine_from_config(
|
|
context.config.get_section(context.config.config_ini_section),
|
|
prefix="sqlalchemy.",
|
|
poolclass=pool.NullPool,
|
|
)
|
|
|
|
with connectable.connect() as connection:
|
|
context.configure(connection=connection, target_metadata=target_metadata)
|
|
with context.begin_transaction():
|
|
context.run_migrations()
|
|
|
|
|
|
run_migrations_online()
|