diff --git a/gso/migrations/versions/2024-04-22_b5dfbc1ec7b2_add_modify_note_workflow_to_new_products.py b/gso/migrations/versions/2024-04-22_b5dfbc1ec7b2_add_modify_note_workflow_to_new_products.py new file mode 100644 index 0000000000000000000000000000000000000000..bff834e101f6cc44cd498a7e273c7d157bf3e05a --- /dev/null +++ b/gso/migrations/versions/2024-04-22_b5dfbc1ec7b2_add_modify_note_workflow_to_new_products.py @@ -0,0 +1,33 @@ +"""Add modify note workflow to new products. + +Revision ID: b5dfbc1ec7b2 +Revises: a1a69e7554c4 +Create Date: 2024-04-22 10:22:00.763401 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = 'b5dfbc1ec7b2' +down_revision = 'a1a69e7554c4' +branch_labels = None +depends_on = None + + +from orchestrator.migrations.helpers import add_products_to_workflow_by_product_tag, \ + remove_products_from_workflow_by_product_tag + +new_workflows = ["Super_POP_SWITCH", "OFFICE_ROUTER", "SWITCH", "LSI", "POP_VLAN", "IMP_IP_TRUNK", "IMP_RTR", "IMP_SITE", "IMP_SPOP_SWITCH", "IMP_OFFICE_RTR"] + + +def upgrade() -> None: + conn = op.get_bind() + for product_tag in new_workflows: + add_products_to_workflow_by_product_tag(conn, "modify_note", product_tag) + + +def downgrade() -> None: + conn = op.get_bind() + for product_tag in new_workflows: + remove_products_from_workflow_by_product_tag(conn, "modify_note", product_tag)