diff --git a/airflow/migrations/versions/0047_3_0_0_add_dag_versioning.py b/airflow/migrations/versions/0047_3_0_0_add_dag_versioning.py index 12ffc174c750a..ca685ae4e071d 100644 --- a/airflow/migrations/versions/0047_3_0_0_add_dag_versioning.py +++ b/airflow/migrations/versions/0047_3_0_0_add_dag_versioning.py @@ -44,8 +44,15 @@ airflow_version = "3.0.0" +def _delete_serdag_and_code(): + op.execute(sa.text("DELETE FROM serialized_dag")) + op.execute(sa.text("DELETE FROM dag_code")) + + def upgrade(): """Apply add dag versioning.""" + # Before creating the dag_version table, we need to delete the existing serialized_dag and dag_code tables + _delete_serdag_and_code() op.create_table( "dag_version", sa.Column("id", UUIDType(binary=False), nullable=False), diff --git a/docs/apache-airflow/img/airflow_erd.sha256 b/docs/apache-airflow/img/airflow_erd.sha256 index c8963880f842e..48700f5604e58 100644 --- a/docs/apache-airflow/img/airflow_erd.sha256 +++ b/docs/apache-airflow/img/airflow_erd.sha256 @@ -1 +1 @@ -f997746cdee45147831f81bcd2d43ec3ca45d7429afa691e385104987ed51d88 \ No newline at end of file +4adae6a26c3378a5da5468eecfcbd27948c2af285a8dcf12ff8c3969e19f19f7 \ No newline at end of file