This is an automated email from the ASF dual-hosted git repository.

uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f58e82332 Fix migration 0080_2_0_2 - Replace null values before 
setting column not null (#24585)
9f58e82332 is described below

commit 9f58e823329d525c0e2b3950ada7e0e047ee7cfd
Author: Tomáš Drtina <[email protected]>
AuthorDate: Wed Jun 29 03:55:41 2022 +0200

    Fix migration 0080_2_0_2 - Replace null values before setting column not 
null (#24585)
---
 airflow/migrations/versions/0080_2_0_2_change_default_pool_slots_to_1.py | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/airflow/migrations/versions/0080_2_0_2_change_default_pool_slots_to_1.py 
b/airflow/migrations/versions/0080_2_0_2_change_default_pool_slots_to_1.py
index f5ae34c297..ef819468ef 100644
--- a/airflow/migrations/versions/0080_2_0_2_change_default_pool_slots_to_1.py
+++ b/airflow/migrations/versions/0080_2_0_2_change_default_pool_slots_to_1.py
@@ -37,6 +37,7 @@ airflow_version = '2.0.2'
 
 def upgrade():
     """Change default ``pool_slots`` to ``1`` and make pool_slots not 
nullable"""
+    op.execute("UPDATE task_instance SET pool_slots = 1 WHERE pool_slots IS 
NULL")
     with op.batch_alter_table("task_instance", schema=None) as batch_op:
         batch_op.alter_column("pool_slots", existing_type=sa.Integer, 
nullable=False, server_default='1')
 

Reply via email to