This commit is contained in:
Timothy J. Baek
2024-09-06 05:30:16 +02:00
parent bfb12a7851
commit 9fe62fc80d
2 changed files with 30 additions and 31 deletions

View File

@@ -0,0 +1,19 @@
from alembic import command
from alembic.config import Config
from open_webui.env import OPEN_WEBUI_DIR
alembic_cfg = Config(OPEN_WEBUI_DIR / "alembic.ini")
# Set the script location dynamically
migrations_path = OPEN_WEBUI_DIR / "migrations"
alembic_cfg.set_main_option("script_location", str(migrations_path))
def revision(message: str) -> None:
command.revision(alembic_cfg, message=message, autogenerate=False)
if __name__ == "__main__":
input_message = input("Enter the revision message: ")
revision(input_message)