Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airflow db downgrade cli command #21596

Merged
merged 2 commits into from
Feb 27, 2022

Conversation

dstandish
Copy link
Contributor

@dstandish dstandish commented Feb 15, 2022

Add db downgrade CLI command

Adds the ability to migrate the airflow metastore schema to a previous alembic revision.

Features:

  • can use version or revision
  • can generate sql for "offline" migration
  • can generate sql for downgrade with from / to revison or versions.

@dstandish dstandish force-pushed the airflow-db-downgrade-cli branch from fec5311 to f96b283 Compare February 15, 2022 19:26
@dstandish dstandish changed the title Airflow db downgrade cli Airflow db downgrade cli command Feb 15, 2022
@dstandish dstandish changed the title Airflow db downgrade cli command Airflow db downgrade cli command Feb 15, 2022
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, is this ready for review?

@dstandish dstandish force-pushed the airflow-db-downgrade-cli branch from f96b283 to 190715e Compare February 23, 2022 22:30
@dstandish dstandish marked this pull request as ready for review February 24, 2022 05:52
@dstandish
Copy link
Contributor Author

dstandish commented Feb 24, 2022

Looks good in general, is this ready for review?

yes

Adds the ability to migrate the airflow metastore schema to a previous alembic revision.

In future we will add support for providing a version tag instead of the alembic revision number.

fixup! Add `db downgrade` CLI command

fixup! fixup! Add `db downgrade` CLI command

add support for  offline migration; add support for  from / to migrations

fix

add more tests

fixup! add more tests
@dstandish dstandish force-pushed the airflow-db-downgrade-cli branch from 5f7a3ff to b5458b3 Compare February 26, 2022 07:00
dstandish added a commit to astronomer/airflow that referenced this pull request Feb 26, 2022
* document airflow version in each alembic migration module and use this to autogen the doc
* update each migration module to have the same description used in migration ref (so it can be used in autogen)

See PR apache#21596 for reference.
@potiuk
Copy link
Member

potiuk commented Feb 27, 2022

LGTM

@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Feb 27, 2022
@potiuk potiuk merged commit 03d6aaa into apache:main Feb 27, 2022
@ephraimbuddy ephraimbuddy deleted the airflow-db-downgrade-cli branch February 28, 2022 07:31
@jedcunningham jedcunningham added the type:new-feature Changelog: New Features label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI full tests needed We need to run full set of tests for this PR to merge type:new-feature Changelog: New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants