jscheffl commented on code in PR #61646:
URL: https://github.com/apache/airflow/pull/61646#discussion_r2977121562


##########
providers/edge3/src/airflow/providers/edge3/migrations/versions/0004_3_3_0_add_team_name_column.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.
+
+"""
+Add team_name column to edge_job and edge_worker tables.
+
+Revision ID: a09c3ee8e1d3
+Revises: 8c275b6fbaa8
+Create Date: 2026-02-07 00:00:00.000000
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = "a09c3ee8e1d3"
+down_revision = "8c275b6fbaa8"
+branch_labels = None
+depends_on = None
+edge3_version = "3.3.0"
+
+
+def upgrade() -> None:
+    conn = op.get_bind()
+    inspector = sa.inspect(conn)
+
+    edge_job_cols = {c["name"] for c in inspector.get_columns("edge_job")}
+    if "team_name" not in edge_job_cols:
+        with op.batch_alter_table("edge_job") as batch_op:

Review Comment:
   I _think_ usually we can trust the migration, based on the version hash the 
DB tooling "knows" either the column exist or not. But keeping this sanity 
check in also does not hurt...



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