Lee-W commented on code in PR #51336:
URL: https://github.com/apache/airflow/pull/51336#discussion_r2122559975
##########
airflow-core/src/airflow/migrations/versions/0017_2_9_2_fix_inconsistency_between_ORM_and_migration_files.py:
##########
@@ -243,8 +243,12 @@ def upgrade():
)
""")
)
-
- conn.execute(sa.text("INSERT INTO dag_run_new SELECT * FROM dag_run"))
+ headers = (
+ "id, dag_id, queued_at, execution_date, start_date, end_date,
state, run_id, creating_job_id, "
+ "external_trigger, run_type, conf, data_interval_start,
data_interval_end, "
+ "last_scheduling_decision, dag_hash, log_template_id, updated_at,
clear_number"
+ )
+ conn.execute(sa.text(f"INSERT INTO dag_run_new ({headers}) SELECT
{headers} FROM dag_run"))
conn.execute(sa.text("DROP TABLE dag_run"))
conn.execute(sa.text("ALTER TABLE dag_run_new RENAME TO dag_run"))
conn.execute(sa.text("PRAGMA foreign_keys=on"))
Review Comment:
yep, we probably could refactor that in a following PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]