18 lines
522 B
Python
18 lines
522 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from alembic import command
|
|
from alembic.config import Config
|
|
|
|
from .common import hub_database_url
|
|
|
|
|
|
def run() -> None:
|
|
config_path = Path("/opt/hub/infrastructure/database/alembic.ini")
|
|
if not config_path.is_file():
|
|
config_path = Path("infrastructure/database/alembic.ini").resolve()
|
|
config = Config(str(config_path))
|
|
config.set_main_option("sqlalchemy.url", hub_database_url().replace("%", "%%"))
|
|
command.upgrade(config, "head")
|