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

Prune the migration files for Airflow 3 #41120

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

ephraimbuddy
Copy link
Contributor

For a long time now, we have been able to create the metadata database from the ORM without going through the migration files. However, the migration files were not pruned because it would result in users being unable to roll back to a previous version. There's now an opportunity to prune this and start afresh. The migration files are getting more significant, and there are benefits to this pruning. Top in my mind is that the FAB migrations will no longer be in the airflow migration file, which would help in removing FAB from the Airflow core.

This change also means we can no longer create a new database from the migration file. We can only do that through the ORM. I considered creating the 'current schema' in the migration file, which means having the database representation in the migration file and helping to create it from scratch. I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed since this creates the database from the migration file.

@ephraimbuddy ephraimbuddy added the airflow3.0:breaking Candidates for Airflow 3.0 that contain breaking changes label Jul 30, 2024
@ephraimbuddy ephraimbuddy force-pushed the prune-migration-file branch 3 times, most recently from 6eed845 to 2762f60 Compare August 12, 2024 07:55
@ephraimbuddy ephraimbuddy marked this pull request as ready for review August 12, 2024 07:55
@ephraimbuddy ephraimbuddy requested review from jedcunningham, potiuk, ashb and kaxil and removed request for ashb, potiuk, kaxil and XD-DENG August 12, 2024 07:55
@ephraimbuddy ephraimbuddy added the full tests needed We need to run full set of tests for this PR to merge label Aug 12, 2024
For a long time now, we have been able to create the metadata
database from the ORM without going through the migration files.
However, the migration files were not pruned because it would
result in users being unable to roll back to a previous version.
There's now an opportunity to prune this and start afresh.
The migration files are getting more significant, and there are
benefits to this pruning. Top in my mind is that the FAB migrations
will no longer be in the airflow migration file, which would help in
removing FAB from the Airflow core.

This change also means we can no longer create a new database from the
migration file. We can only do that through the ORM. I considered creating
the 'current schema' in the migration file, which means having the database
representation in the migration file and helping to create it from scratch.
I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed
since this creates the database from the migration file.
@jedcunningham
Copy link
Member

Overall LGMT, but we need to figure out what the min version we support upgrading from should be (2.10 vs some earlier 2.x). Ephraim is going to see where the FAB things are so in the migration files so we can figure out the best balance here.

@potiuk
Copy link
Member

potiuk commented Aug 12, 2024

Good point - my proposal is that migration from 2.x & should be another migration step (possibly combined with the main migrate command (but done via "compat/migration tool" - to bring it to 2.10.0 version using old scripts and then follow from that using Airflow 3 migrations only.

This way we could allow a direct migration from pre 2.10 versions as well.

@ephraimbuddy
Copy link
Contributor Author

FAB-related migrations stopped at 2.6.0, so we are at liberty to still have the migration cut off way down, but I think we should cut 3.0.0 migration at 2.10 as in this PR and have a migration tool for anyone upgrading, as @potiuk suggested.

@ephraimbuddy
Copy link
Contributor Author

Merging this, we can still extend it to lower versions if need be

@ephraimbuddy ephraimbuddy merged commit ba4d4a0 into apache:main Aug 13, 2024
80 checks passed
@ephraimbuddy ephraimbuddy deleted the prune-migration-file branch August 13, 2024 08:05
Artuz37 pushed a commit to Artuz37/airflow that referenced this pull request Aug 13, 2024
* Prune the migration files for Airflow 3

For a long time now, we have been able to create the metadata
database from the ORM without going through the migration files.
However, the migration files were not pruned because it would
result in users being unable to roll back to a previous version.
There's now an opportunity to prune this and start afresh.
The migration files are getting more significant, and there are
benefits to this pruning. Top in my mind is that the FAB migrations
will no longer be in the airflow migration file, which would help in
removing FAB from the Airflow core.

This change also means we can no longer create a new database from the
migration file. We can only do that through the ORM. I considered creating
the 'current schema' in the migration file, which means having the database
representation in the migration file and helping to create it from scratch.
I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed
since this creates the database from the migration file.

* fixup! Prune the migration files for Airflow 3
Artuz37 pushed a commit to Artuz37/airflow that referenced this pull request Aug 13, 2024
* Prune the migration files for Airflow 3

For a long time now, we have been able to create the metadata
database from the ORM without going through the migration files.
However, the migration files were not pruned because it would
result in users being unable to roll back to a previous version.
There's now an opportunity to prune this and start afresh.
The migration files are getting more significant, and there are
benefits to this pruning. Top in my mind is that the FAB migrations
will no longer be in the airflow migration file, which would help in
removing FAB from the Airflow core.

This change also means we can no longer create a new database from the
migration file. We can only do that through the ORM. I considered creating
the 'current schema' in the migration file, which means having the database
representation in the migration file and helping to create it from scratch.
I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed
since this creates the database from the migration file.

* fixup! Prune the migration files for Airflow 3
molcay pushed a commit to VladaZakharova/airflow that referenced this pull request Aug 19, 2024
* Prune the migration files for Airflow 3

For a long time now, we have been able to create the metadata
database from the ORM without going through the migration files.
However, the migration files were not pruned because it would
result in users being unable to roll back to a previous version.
There's now an opportunity to prune this and start afresh.
The migration files are getting more significant, and there are
benefits to this pruning. Top in my mind is that the FAB migrations
will no longer be in the airflow migration file, which would help in
removing FAB from the Airflow core.

This change also means we can no longer create a new database from the
migration file. We can only do that through the ORM. I considered creating
the 'current schema' in the migration file, which means having the database
representation in the migration file and helping to create it from scratch.
I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed
since this creates the database from the migration file.

* fixup! Prune the migration files for Airflow 3
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Aug 20, 2024
* Prune the migration files for Airflow 3

For a long time now, we have been able to create the metadata
database from the ORM without going through the migration files.
However, the migration files were not pruned because it would
result in users being unable to roll back to a previous version.
There's now an opportunity to prune this and start afresh.
The migration files are getting more significant, and there are
benefits to this pruning. Top in my mind is that the FAB migrations
will no longer be in the airflow migration file, which would help in
removing FAB from the Airflow core.

This change also means we can no longer create a new database from the
migration file. We can only do that through the ORM. I considered creating
the 'current schema' in the migration file, which means having the database
representation in the migration file and helping to create it from scratch.
I dropped the idea because there would be elements of FAB in the migration files again.

Due to this change, the db command option "--use-migration-files" was removed
since this creates the database from the migration file.

* fixup! Prune the migration files for Airflow 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-79 airflow3.0:breaking Candidates for Airflow 3.0 that contain breaking changes area:CLI area:db-migrations PRs with DB migration area:dev-tools full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants