mistercrunch commented on code in PR #30398:
URL: https://github.com/apache/superset/pull/30398#discussion_r1861238853


##########
superset/migrations/versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py:
##########
@@ -0,0 +1,47 @@
+# 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.
+"""UUIDMixin
+
+Revision ID: 7b17aa722e30
+Revises: 48cbb571fa3a
+Create Date: 2024-09-25 17:59:21.028426
+
+"""
+
+import sqlalchemy as sa
+import sqlalchemy_utils
+from alembic import op
+
+# revision identifiers, used by Alembic.
+revision = "7b17aa722e30"
+down_revision = "48cbb571fa3a"
+
+
+def upgrade():
+    op.add_column(

Review Comment:
   Seem like a decent idea, though wondering how to best to this. Not sure if 
false-negative or swallowed errors on db migrations is a thing, personally I 
don't think I've ever seen it. I've seen migrations that fail half-way through 
and bad states, but always with a clear error message.
   
   Taking a step back and thinking about improving migrations-related code / 
process. One thing I'd like seen is collapsing/cleaning database migrations. 
   
   ```
   $ find superset/migrations/versions/|wc  -l
        980
   ```
   
   Currently we have 980 migrations, I could collapse since say 1.0.0 or 2.0.0 
and end up with much less migrations. Not sure if worth our while.
   
   Maybe a more important thing I could spend a cycle or two on would be to 
clean the mismatches. When running alembic, it becomes evident that there's a 
lot of differences between what's declared in models and what's in the physical 
database, resulting on a vanilla alembic run generating lots of output.
   
   If I was to align 100% on alembic, we could have a CI script that prevents 
deriving away between what's declared and how it gets stamped in the database.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to