Skip to content

Commit

Permalink
Fix upgrade docs to reflect true cli flags available (apache#37231)
Browse files Browse the repository at this point in the history
* Fix upgrade docs to reflect true cli arguments available

* Add in to version for parity

* Use shortened flag in first example
  • Loading branch information
jdistler authored and abhishekbhakat committed Mar 5, 2024
1 parent 238bb22 commit 929a5cb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions docs/apache-airflow/installation/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ you access to Airflow ``CLI`` :doc:`/howto/usage-cli` and the database.

Offline SQL migration scripts
=============================
If you want to run the upgrade script offline, you can use the ``-r`` or ``--revision-range`` flag
to get the SQL statements that would be executed. This feature is supported in Postgres and MySQL
If you want to run the upgrade script offline, you can use the ``-s`` or ``--show-sql-only`` flag
to get the SQL statements that would be executed. You may also specify the starting airflow version with the ``--from-version`` flag and the ending airflow version with the ``-n`` or ``--to-version`` flag. This feature is supported in Postgres and MySQL
from Airflow 2.0.0 onward.

Sample usage:
``airflow db migrate -r "2.0.0:2.2.0"``
``airflow db migrate --revision-range "e959f08ac86c:142555e44c17"``

But for Airflow version 2.7.0 or greater, please use
``airflow db migrate -r "2.0.0:2.2.0"``
``airflow db migrate --revision-range "e959f08ac86c:142555e44c17"``
Sample usage for Airflow version 2.7.0 or greater:
``airflow db migrate -s --from-version "2.4.3" -n "2.7.3"``
``airflow db migrate --show-sql-only --from-version "2.4.3" --to-version "2.7.3"``

.. note::
``airflow db upgrade`` has been replaced by ``airflow db migrate`` since Airflow version 2.7.0
Expand Down

0 comments on commit 929a5cb

Please sign in to comment.