-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new components_json field to the jira_fields table.
- Loading branch information
1 parent
d3db8b7
commit b85e26a
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
alembic/versions/1b085cf9c085_add_columns_json_to_jira_fields_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"""add columns_json to jira_fields table | ||
Revision ID: 1b085cf9c085 | ||
Revises: 54f755dbdb6f | ||
Create Date: 2024-12-16 18:32:07.304537 | ||
""" | ||
import logging | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1b085cf9c085" | ||
down_revision = "54f755dbdb6f" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
JIRA_FIELDS_TABLE_NAME = "jira_fields" | ||
|
||
|
||
def upgrade(log: logging.Logger, table_names: set[str]) -> None: | ||
if JIRA_FIELDS_TABLE_NAME not in table_names: | ||
log.info(f"No {JIRA_FIELDS_TABLE_NAME} table; nothing to do") | ||
return | ||
log.info("Add 'columns_json'") | ||
|
||
op.add_column( | ||
JIRA_FIELDS_TABLE_NAME, | ||
sa.Column("columns_json", sa.JSON(), nullable=True), | ||
) | ||
|
||
|
||
def downgrade(log: logging.Logger, table_names: set[str]) -> None: | ||
if JIRA_FIELDS_TABLE_NAME not in table_names: | ||
log.info(f"No {JIRA_FIELDS_TABLE_NAME} table; nothing to do") | ||
return | ||
|
||
log.info("Drop 'columns_json'") | ||
op.drop_column(JIRA_FIELDS_TABLE_NAME, "columns_json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters