uranusjr commented on code in PR #57836:
URL: https://github.com/apache/airflow/pull/57836#discussion_r2492589851


##########
airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py:
##########
@@ -56,15 +56,16 @@ def upgrade():
     with op.batch_alter_table("callback", schema=None) as batch_op:
         batch_op.add_column(sa.Column("type", sa.String(length=20), 
nullable=False))
         batch_op.add_column(sa.Column("fetch_method", sa.String(length=20), 
nullable=False))
-        batch_op.add_column(sa.Column("data", 
airflow.utils.sqlalchemy.ExtendedJSON(), nullable=True))
+        batch_op.add_column(sa.Column("data", ExtendedJSON(), nullable=False))
         batch_op.add_column(sa.Column("state", sa.String(length=10), 
nullable=True))
         batch_op.add_column(sa.Column("output", sa.Text(), nullable=True))
         batch_op.add_column(sa.Column("trigger_id", sa.Integer(), 
nullable=True))
         batch_op.create_foreign_key(batch_op.f("callback_trigger_id_fkey"), 
"trigger", ["trigger_id"], ["id"])
 
         # Replace INTEGER id with UUID id
         batch_op.drop_column("id")
-        batch_op.add_column(sa.Column("id", UUIDType(binary=False), 
nullable=False, primary_key=True))
+        batch_op.add_column(sa.Column("id", UUIDType(binary=False), 
nullable=False))
+        batch_op.create_primary_key("callback_pkey", ["id"])

Review Comment:
   Is this needed?



##########
airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py:
##########
@@ -56,15 +56,16 @@ def upgrade():
     with op.batch_alter_table("callback", schema=None) as batch_op:
         batch_op.add_column(sa.Column("type", sa.String(length=20), 
nullable=False))
         batch_op.add_column(sa.Column("fetch_method", sa.String(length=20), 
nullable=False))
-        batch_op.add_column(sa.Column("data", 
airflow.utils.sqlalchemy.ExtendedJSON(), nullable=True))
+        batch_op.add_column(sa.Column("data", ExtendedJSON(), nullable=False))
         batch_op.add_column(sa.Column("state", sa.String(length=10), 
nullable=True))
         batch_op.add_column(sa.Column("output", sa.Text(), nullable=True))
         batch_op.add_column(sa.Column("trigger_id", sa.Integer(), 
nullable=True))
         batch_op.create_foreign_key(batch_op.f("callback_trigger_id_fkey"), 
"trigger", ["trigger_id"], ["id"])
 
         # Replace INTEGER id with UUID id
         batch_op.drop_column("id")
-        batch_op.add_column(sa.Column("id", UUIDType(binary=False), 
nullable=False, primary_key=True))
+        batch_op.add_column(sa.Column("id", UUIDType(binary=False), 
nullable=False))
+        batch_op.create_primary_key("callback_pkey", ["id"])

Review Comment:
   Is this change needed?



-- 
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]

Reply via email to