You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/06/29 15:20:29 UTC

[airflow] 44/45: Fix migration 0080_2_0_2 - Replace null values before setting column not null (#24585)

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

ephraimanierobi pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 79fe04558e79638acb5a5b79ce5b6011e48720ed
Author: Tomáš Drtina <tm...@gmail.com>
AuthorDate: Wed Jun 29 03:55:41 2022 +0200

    Fix migration 0080_2_0_2 - Replace null values before setting column not null (#24585)
    
    (cherry picked from commit 9f58e823329d525c0e2b3950ada7e0e047ee7cfd)
---
 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')