diff --git a/gso/migrations/versions/2024-10-29_72a4f7aa499d_add_l2circuit_workflows.py b/gso/migrations/versions/2024-10-29_72a4f7aa499d_add_l2circuit_workflows.py new file mode 100644 index 0000000000000000000000000000000000000000..93ee541a23345ca01f3dd3a4623ee483058e1221 --- /dev/null +++ b/gso/migrations/versions/2024-10-29_72a4f7aa499d_add_l2circuit_workflows.py @@ -0,0 +1,45 @@ +"""Add L2Circuit workflows.. + +Revision ID: 72a4f7aa499d +Revises: 5132c463214d +Create Date: 2024-10-29 14:04:29.807253 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = '72a4f7aa499d' +down_revision = '5132c463214d' +branch_labels = None +depends_on = None + + +from orchestrator.migrations.helpers import create_workflow, delete_workflow + +new_workflows = [ + { + "name": "create_layer_2_circuit", + "target": "CREATE", + "description": "Create Layer 2 Circuit Service", + "product_type": "Layer2Circuit" + }, + { + "name": "modify_layer_2_circuit", + "target": "MODIFY", + "description": "Modify Layer 2 Circuit Service", + "product_type": "Layer2Circuit" + } +] + + +def upgrade() -> None: + conn = op.get_bind() + for workflow in new_workflows: + create_workflow(conn, workflow) + + +def downgrade() -> None: + conn = op.get_bind() + for workflow in new_workflows: + delete_workflow(conn, workflow["name"])