kaxil commented on code in PR #42913:
URL: https://github.com/apache/airflow/pull/42913#discussion_r1823533331


##########
airflow/migrations/versions/0045_3_0_0_add_dag_versioning.py:
##########
@@ -0,0 +1,151 @@
+#
+# 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 versioning.
+
+Revision ID: 2b47dc6bc8df
+Revises: 5f57a45b8433
+Create Date: 2024-10-09 05:44:04.670984
+
+"""
+
+from __future__ import annotations
+
+import sqlalchemy as sa
+from alembic import op
+from sqlalchemy_utils import UUIDType
+
+from airflow.migrations.db_types import StringID
+from airflow.models.base import naming_convention
+from airflow.utils import timezone
+from airflow.utils.sqlalchemy import UtcDateTime
+
+# revision identifiers, used by Alembic.
+revision = "2b47dc6bc8df"
+down_revision = "5f57a45b8433"
+branch_labels = None
+depends_on = None
+airflow_version = "3.0.0"
+
+
+def upgrade():
+    """Apply add dag versioning."""
+    op.create_table(
+        "dag_version",
+        sa.Column("id", UUIDType(binary=False), nullable=False),

Review Comment:
   The `sqlalchemy-utils` lib also uses `uuid` from Python stdlib -- which is 
uuid4.
   
   https://docs.python.org/3/library/uuid.html
   
   
https://github.com/kvesteri/sqlalchemy-utils/blob/baf53cd1a3e779fc127010543fed53cf4a97fe16/sqlalchemy_utils/types/uuid.py#L12
   
   ---
   
   This is not a problem btw if you are just looking for a random identifier. 
But if you want intend to query it frequently and thereby plan to create 
indexes on it -- UUID7 would be ideal because of its temporal capabilities



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to