-
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.
Also add deprecation advice and code comments for systems, subsystems, cscs, components, primary_software_components and primary_hardware_components.
- Loading branch information
1 parent
d3db8b7
commit 66b8f7d
Showing
6 changed files
with
290 additions
and
31 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
alembic/versions/49ef39173f83_add_components_json_field_to_jira_.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,42 @@ | ||
"""add components_json field to jira_fields table | ||
Revision ID: 49ef39173f83 | ||
Revises: 54f755dbdb6f | ||
Create Date: 2024-12-18 17:01:39.676895 | ||
""" | ||
import logging | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "49ef39173f83" | ||
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 'components_json'") | ||
|
||
op.add_column( | ||
JIRA_FIELDS_TABLE_NAME, | ||
sa.Column("components_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 'components_json'") | ||
op.drop_column(JIRA_FIELDS_TABLE_NAME, "components_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
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
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
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
Oops, something went wrong.