ephraimbuddy commented on code in PR #48512:
URL: https://github.com/apache/airflow/pull/48512#discussion_r2030123775
##########
airflow-core/src/airflow/migrations/versions/0041_3_0_0_rename_dataset_as_asset.py:
##########
@@ -301,9 +348,12 @@ def upgrade():
if op.get_bind().dialect.name in ("postgresql", "mysql"):
batch_op.drop_constraint("ddrq_dataset_fkey", type_="foreignkey")
- _rename_pk_constraint(
+ with op.batch_alter_table("asset_dag_run_queue", schema=None) as batch_op:
+ _rename_pk_constraint_unkown(
batch_op=batch_op,
- original_name="datasetdagrunqueue_pkey",
+ table_name="asset_dag_run_queue",
+ original_name="dataset_dag_run_queue_pkey",
+ alternative_name="datasetdagrunqueue_pkey",
Review Comment:
In Airflow 2, these were different names for ORM and migration files. If
users upgraded through migration file, they would have one of the names. If
they created the db from ORM, they would also have one of the names. So I did
it this way so that no matter the name that came up, we could drop it and
rename it to the new name
--
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]