Remove old pre-migration data integrity checks #41850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These checks were put into place early in 2.x to add stricter constraints in the database. They are executed before the migrations when the user runs 'airflow upgradedb' to make sure there are no data integrity issues that would fail the migration halfway, which is both difficult to debug and recover from.
The checks always pass if the user is on a more recent Airflow 2 version, on which the constraints are now enforced by the database. Since we have removed all migration files prior to 2.10, the user must upgrade to at least 2.10 first (which has the checks) before upgrading to 3.0 anyway, so we can safely remove the checks going forward.
(Additional context: these checks need to be modified if we are to rename
execution_dateon DagRun, which I’m doing in #41818. Instead of needing to work on the change, I think we should remove those checks since they don’t ever need to be run anyway.)