Files
zenml/venv/lib/python3.9/site-packages/mlflow/db.py
Christian Mantha 2ca0b9ef7c star
2026-03-02 19:10:52 -05:00

28 lines
872 B
Python

import click
@click.group("db")
def commands():
"""
Commands for managing an MLflow tracking database.
"""
@commands.command()
@click.argument("url")
def upgrade(url):
"""
Upgrade the schema of an MLflow tracking database to the latest supported version.
**IMPORTANT**: Schema migrations can be slow and are not guaranteed to be transactional -
**always take a backup of your database before running migrations**. The migrations README,
which is located at
https://github.com/mlflow/mlflow/blob/master/mlflow/store/db_migrations/README.md, describes
large migrations and includes information about how to estimate their performance and
recover from failures.
"""
import mlflow.store.db.utils
engine = mlflow.store.db.utils.create_sqlalchemy_engine_with_retry(url)
mlflow.store.db.utils._upgrade_db(engine)