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 2020/12/07 21:54:31 UTC

[GitHub] [airflow] ashb commented on a change in pull request #12890: Changes the type of source_code field in DagCode to MEDIUMTEXT

ashb commented on a change in pull request #12890:
URL: https://github.com/apache/airflow/pull/12890#discussion_r537860951



##########
File path: airflow/migrations/versions/e959f08ac86c_change_field_in_dagcode_to_mediumtext_.py
##########
@@ -0,0 +1,43 @@
+#
+# 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.
+
+"""Change field in DagCode to MEDIUMTEXT for MySql
+
+Revision ID: e959f08ac86c
+Revises: 64a7d6477aae
+Create Date: 2020-12-07 16:31:43.982353
+
+"""
+from alembic import context, op
+from sqlalchemy.dialects import mysql
+
+# revision identifiers, used by Alembic.
+revision = 'e959f08ac86c'
+down_revision = '64a7d6477aae'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():  # noqa: D103
+    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):

Review comment:
       The op.get_bind() style is used much more:
   
   ```
   co~/code/airflow/airflow master*
   airflow ❯ git grep conn.dialect.name ./airflow/migrations/versions | wc -l
   54
   
   ~/code/airflow/airflow master*
   airflow ❯ git grep context.config.get_main_option ./airflow/migrations/versions | wc -l
   4
   ```




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