forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.py
29 lines (23 loc) · 940 Bytes
/
db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import click
import mlflow.store.db.utils
@click.group("db")
def commands():
"""
Commands for managing an MLflow tracking database.
"""
pass
@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.
"""
if mlflow.store.db.utils._is_initialized_before_mlflow_1(url):
mlflow.store.db.utils._upgrade_db_initialized_before_mlflow_1(url)
mlflow.store.db.utils._upgrade_db(url)