from importlib.resources import files
from alembic import command
from alembic.config import Config


def run_migrations(db_url: str) -> None:
    migrations_path = files("vdash").joinpath("migrations")

    cfg = Config()
    cfg.set_main_option("script_location", str(migrations_path))
    cfg.set_main_option("sqlalchemy.url", db_url)  

    command.upgrade(cfg, "head")
