Skip to content

Commit fd87589

Browse files
committed
Update trigger kwargs migration to specify existing_nullable (#39361)
Without the existing_nullable set during alter_column, MySQL will set it to Null. See https://alembic.sqlalchemy.org/en/latest/ops.html#alembic.operations.Operations.alter_column.params.existing_nullable (cherry picked from commit 1d504ca)
1 parent 5356cb9 commit fd87589

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

airflow/migrations/versions/0140_2_9_0_update_trigger_kwargs_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_session() -> sa.orm.Session:
5050
def upgrade():
5151
"""Update trigger kwargs type to string and encrypt"""
5252
with op.batch_alter_table("trigger") as batch_op:
53-
batch_op.alter_column("kwargs", type_=sa.Text(), )
53+
batch_op.alter_column("kwargs", type_=sa.Text(), existing_nullable=False)
5454

5555
if not context.is_offline_mode():
5656
session = get_session()
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
818cbc5af55096456b556d62e73eb5d797001969a04256f4a99e097fe189855d
1+
4a8aed085996d893909588dabe45906213629a545bbce7b551189c85121f88bd

0 commit comments

Comments
 (0)