-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from multiflexi/attr_desc
Attribute description - CWE
- Loading branch information
Showing
8 changed files
with
921 additions
and
270 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/core/migrations/versions/90249a322ae1_add_value_descriptipn.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,32 @@ | ||
"""Add value description to report item attribute table | ||
Revision ID: 90249a322ae1 | ||
Revises: 57d784d699d9 | ||
Create Date: 2024-02-25 19:00:13.825003 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.engine.reflection import Inspector | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "90249a322ae1" | ||
down_revision = "57d784d699d9" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) | ||
if "value_description" not in [column["name"] for column in inspector.get_columns("report_item_attribute")]: | ||
op.add_column("report_item_attribute", sa.Column("value_description", sa.String(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
conn = op.get_bind() | ||
inspector = Inspector.from_engine(conn) | ||
if "value_description" in [column["name"] for column in inspector.get_columns("report_item_attribute")]: | ||
op.drop_column("report_item_attribute", "value_description") |
Large diffs are not rendered by default.
Oops, something went wrong.
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.