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/03/26 08:07:31 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22537: Consistent DB upgrade/downgrade arguments

ephraimbuddy commented on a change in pull request #22537:
URL: https://github.com/apache/airflow/pull/22537#discussion_r835736135



##########
File path: airflow/cli/commands/db_command.py
##########
@@ -49,15 +49,15 @@ def resetdb(args):
 def upgradedb(args):
     """Upgrades the metadata database"""
     print("DB: " + repr(settings.engine.url))
-    if args.revision and args.version:
-        raise SystemExit("Cannot supply both `--revision` and `--version`.")
+    if args.to_revision and args.to_version:
+        raise SystemExit("Cannot supply both `--to-revision` and `--to-version`.")
     if args.from_version and args.from_revision:
         raise SystemExit("Cannot supply both `--from-revision` and `--from-version`")
     if (args.from_revision or args.from_version) and not args.show_sql_only:
         raise SystemExit(
             "Args `--from-revision` and `--from-version` may only be used with `--show-sql-only`"

Review comment:
       Looks like when we use `--from-version`  or `--from-revision` we must use `--show-sql-only`. Should we make it to run real migration if the flag is used and raise error only if the user's version/revision is not the same with the supplied `--from-revision` /`--from-version`




-- 
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