You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/07/31 13:25:40 UTC

[GitHub] [airflow] ashb commented on a change in pull request #5349: [AIRFLOW-4591] Make default_pool a real pool

ashb commented on a change in pull request #5349: [AIRFLOW-4591] Make default_pool a real pool
URL: https://github.com/apache/airflow/pull/5349#discussion_r309217923
 
 

 ##########
 File path: airflow/migrations/versions/6e96a59344a4_make_taskinstance_pool_not_nullable.py
 ##########
 @@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Make TaskInstance.pool not nullable
+
+Revision ID: 6e96a59344a4
+Revises: 939bb1e647c8
+Create Date: 2019-06-13 21:51:32.878437
+
+"""
+
+from alembic import op
+import sqlalchemy as sa
+
+# revision identifiers, used by Alembic.
+revision = '6e96a59344a4'
+down_revision = '939bb1e647c8'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    """
+    Make TaskInstance.pool field not nullable.
+    """
+    # use batch_alter_table to support SQLite workaround
+    with op.batch_alter_table('task_instance') as batch_op:
+        batch_op.alter_column(
+            column_name='pool',
+            type_=sa.String(50),
+            nullable=False,
 
 Review comment:
   Doesn't that make that an expensive operation on MSSQL - needing to re-create the entire index?  (Not that there's an option but that seems expensive)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services