chore: migrate to more db migration utils (#33155)

This commit is contained in:
Elizabeth Thompson
2025-04-22 11:26:54 -07:00
committed by GitHub
parent ae48dba3e1
commit b6628cdfd2
6 changed files with 48 additions and 45 deletions

View File

@@ -303,7 +303,7 @@ def add_columns(table_name: str, *columns: Column) -> None:
"""
Adds new columns to an existing database table.
If a column already exist, it logs an informational message and skips the adding process.
If a column already exist, or the table doesn't exist, it logs an informational message and skips the adding process.
Otherwise, it proceeds to add the new column to the table.
The operation is performed using Alembic's batch_alter_table.
@@ -333,7 +333,7 @@ def drop_columns(table_name: str, *columns: str) -> None:
"""
Drops specified columns from an existing database table.
If a column does not exist, it logs an informational message and skips the dropping process.
If a column or table does not exist, it logs an informational message and skips the dropping process.
Otherwise, it proceeds to remove the column from the table.
The operation is performed using Alembic's batch_alter_table.