You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/15 21:23:00 UTC
[GitHub] [airflow] kaxil commented on a change in pull request #20838: Add `db clean` CLI command for purging old data
kaxil commented on a change in pull request #20838:
URL: https://github.com/apache/airflow/pull/20838#discussion_r807326376
##########
File path: airflow/cli/commands/db_command.py
##########
@@ -94,3 +95,26 @@ def shell(args):
def check(_):
"""Runs a check command that checks if db is available."""
db.check()
+
+
+@cli_utils.action_cli(check_db=False)
+def clean(args):
+ """Upgrades the metadata database"""
+ print(f"DB: {settings.engine.url!r}")
+ db.upgradedb()
+
+
+# lazily imported by CLI parser for `help` command
+all_tables = sorted(config_dict)
+
+
+@cli_utils.action_cli(check_db=False)
+def cleanup_tables(args):
+ """Purges old records in metastore database"""
Review comment:
nit: There are different versions of same name "metadata database" (L102), "metastore database" (L113) and "metastore tables" (L1324 of `airflow/cli/cli_parser.py`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org