You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/03/25 22:19:16 UTC

(superset) 01/01: chore: update migrations to use utils

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

jli pushed a commit to branch joe/update-migration-to-use-utils
in repository https://gitbox.apache.org/repos/asf/superset.git

commit e993b55d4e6460f9a47e7014001392c95a18a699
Author: Joe Li <jo...@preset.io>
AuthorDate: Tue Mar 25 15:18:58 2025 -0700

    chore: update migrations to use utils
---
 .../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..fb675a57d5 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_column, drop_column
+
 # revision identifiers, used by Alembic.
 revision = "94e7a3499973"
 down_revision = "74ad1125881c"
 
 
 def upgrade():
-    op.add_column(
+    add_column(
         "tables",
         sa.Column("folders", JSON, nullable=True),
     )
 
 
 def downgrade():
-    op.drop_column("tables", "folders")
+    drop_column("tables", "folders")