Skip to content
Snippets Groups Projects

Draft: add start and terminate workflow tasks for routers

5 files
+ 117
0
Compare changes
  • Side-by-side
  • Inline

Files

 
"""add moodi run and terminate workflow tasks for routers.
 
 
Revision ID: e86c16d809ab
 
Revises: a3177c5f9641
 
Create Date: 2025-04-29 17:14:51.627317
 
 
"""
 
import sqlalchemy as sa
 
from alembic import op
 
 
# revision identifiers, used by Alembic.
 
revision = 'e86c16d809ab'
 
down_revision = 'a3177c5f9641'
 
branch_labels = None
 
depends_on = None
 
 
 
from orchestrator.migrations.helpers import create_workflow, delete_workflow
 
 
new_workflows = [
 
{
 
"name": "run_moodi",
 
"target": "SYSTEM",
 
"description": "Run Moodi Service",
 
"product_type": "Router"
 
},
 
{
 
"name": "terminate_moodi",
 
"target": "SYSTEM",
 
"description": "Terminate Moodi Service",
 
"product_type": "Router"
 
}
 
]
 
 
 
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"])
Loading