alexott commented on code in PR #25280:
URL: https://github.com/apache/airflow/pull/25280#discussion_r939639061


##########
airflow/migrations/versions/0116_2_4_0_add_dag_owner_attributes_table.py:
##########
@@ -0,0 +1,52 @@
+#
+# 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.
+
+"""add dag_owner_attributes table
+
+Revision ID: 1486deb605b4
+Revises: f4ff391becb5
+Create Date: 2022-08-04 16:59:45.406589
+
+"""
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = '1486deb605b4'
+down_revision = 'f4ff391becb5'
+branch_labels = None
+depends_on = None
+airflow_version = '2.4.0'
+
+
+def upgrade():
+    """Apply Add ``DagOwnerAttributes`` table"""
+    op.create_table(
+        'dag_owner_attributes',

Review Comment:
   Addition of this table causes the issue when updating because the generated 
code:
   
   ```sql
   CREATE TABLE dag_owner_attributes (
        dag_id VARCHAR(250) NOT NULL, 
        owner VARCHAR(500) NOT NULL, 
        link VARCHAR(500) NOT NULL, 
        CONSTRAINT dag_owner_attributes_pkey PRIMARY KEY (dag_id, owner), 
        CONSTRAINT dag_owner_attributes_dag_id_fkey FOREIGN KEY(dag_id) 
REFERENCES dag (dag_id) ON DELETE CASCADE
   )
   ```
   
   while to make it working, the `dag_id` needs to be declared as `dag_id 
VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL`
   
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to