Skip to content
Snippets Groups Projects

Update the product validation task

All threads resolved!
Files
11
"""Add task_validate_geant_products.
Revision ID: 31fd1ae8d5bb
Revises: 3323bcb934e7
Create Date: 2024-07-15 15:34:00.00000
"""
from uuid import uuid4
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "31fd1ae8d5bb"
down_revision = "b5dfbc1ec7b2"
branch_labels = None
depends_on = None
workflows = [
{"name": "task_validate_geant_products", "description": "Validate GEANT products", "workflow_id": uuid4(), "target": "SYSTEM"},
]
def upgrade() -> None:
conn = op.get_bind()
for workflow in workflows:
conn.execute(
sa.text(
"INSERT INTO workflows VALUES (:workflow_id, :name, :target, :description, now()) ON CONFLICT DO NOTHING"
),
workflow,
)
def downgrade() -> None:
conn = op.get_bind()
for workflow in workflows:
conn.execute(sa.text("DELETE FROM workflows WHERE name = :name"), {"name": workflow["name"]})
Loading