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/29 23:07:37 UTC

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

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



##########
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:
       my 2c, that would make it so that, when used without `sql-only`, the arg `--from-version` would only be allowed when it has _no effect_; in that case it seems to me it makes sense to just not accept it.    is there some benefit to accepting the arg in that case?
   it would make the documentation more cumbersome too.




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