This is an automated email from the ASF dual-hosted git repository.

jli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 50fe7483ae chore: update migrations to use utils (#32852)
50fe7483ae is described below

commit 50fe7483ae3f7fa02a476b9e5e384bd0031359d7
Author: Joe Li <[email protected]>
AuthorDate: Wed Mar 26 10:29:04 2025 -0700

    chore: update migrations to use utils (#32852)
---
 .../versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py       | 11 ++++++-----
 ...-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py |  7 ++++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/superset/migrations/versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py 
b/superset/migrations/versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py
index 2366d3bf26..9cc3735f28 100644
--- a/superset/migrations/versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py
+++ b/superset/migrations/versions/2024-09-25_17-59_7b17aa722e30_uuidmixin.py
@@ -24,7 +24,8 @@ Create Date: 2024-09-25 17:59:21.028426
 
 import sqlalchemy as sa
 import sqlalchemy_utils
-from alembic import op
+
+from superset.migrations.shared.utils import add_columns, drop_columns
 
 # revision identifiers, used by Alembic.
 revision = "7b17aa722e30"
@@ -32,16 +33,16 @@ down_revision = "48cbb571fa3a"
 
 
 def upgrade():
-    op.add_column(
+    add_columns(
         "css_templates",
         sa.Column("uuid", sqlalchemy_utils.types.uuid.UUIDType(), 
nullable=True),
     )
-    op.add_column(
+    add_columns(
         "favstar",
         sa.Column("uuid", sqlalchemy_utils.types.uuid.UUIDType(), 
nullable=True),
     )
 
 
 def downgrade():
-    op.drop_column("css_templates", "uuid")
-    op.drop_column("favstar", "uuid")
+    drop_columns("css_templates", "uuid")
+    drop_columns("favstar", "uuid")
diff --git 
a/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
 
b/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
index 3e767f36a6..e9f7d387c5 100644
--- 
a/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
+++ 
b/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
@@ -23,20 +23,21 @@ Create Date: 2025-03-03 20:52:24.585143
 """
 
 import sqlalchemy as sa
-from alembic import op
 from sqlalchemy.types import JSON
 
+from superset.migrations.shared.utils import add_columns, drop_columns
+
 # revision identifiers, used by Alembic.
 revision = "94e7a3499973"
 down_revision = "74ad1125881c"
 
 
 def upgrade():
-    op.add_column(
+    add_columns(
         "tables",
         sa.Column("folders", JSON, nullable=True),
     )
 
 
 def downgrade():
-    op.drop_column("tables", "folders")
+    drop_columns("tables", "folders")

Reply via email to