ashb commented on a change in pull request #20962:
URL: https://github.com/apache/airflow/pull/20962#discussion_r792083778
##########
File path: airflow/utils/db.py
##########
@@ -1018,8 +1018,18 @@ def upgradedb(session: Session = NEW_SESSION):
exit(1)
with create_global_lock(session=session, lock=DBLocks.MIGRATIONS):
- log.info("Creating tables")
- command.upgrade(config, 'heads')
+ log.info("Running migrations")
+ rev_2_0_0_head = 'e959f08ac86c'
+ _lowerband = revision.split(':')[0] if ":" in revision else None
+ if _lowerband and _lowerband != rev_2_0_0_head:
+ sql = True # Set to true if user passes a range of revisions
+ try:
+ command.history(config,
rev_range=f"{rev_2_0_0_head}:{_lowerband}")
+ except Exception:
+ raise AirflowException(
+ f"Supported revision is from {rev_2_0_0_head} which is
airflow 2.0.0 head"
+ )
Review comment:
This won't work if you try to have a revision range from (for example)
2.2.0->2.2.4 will it?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]