Classer les interventions existantes par workflow
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run

This commit is contained in:
root 2026-08-21 10:16:07 +00:00
parent 30ccee3a2a
commit d1fef99def

View file

@ -0,0 +1,16 @@
"""Classe les interventions existantes par workflow."""
from alembic import op
import sqlalchemy as sa
revision = "fg7b8c9d0e1f"
down_revision = "ff6a7b8c9d0e"
branch_labels = None
depends_on = None
def upgrade():
op.execute(sa.text("UPDATE interventions SET workflow_type='preventive' WHERE type='preventif'"))
op.execute(sa.text("UPDATE interventions SET workflow_type='travaux' WHERE type='amelioratif'"))
op.execute(sa.text("UPDATE interventions SET workflow_type='prevention' WHERE type IN ('prevention','administratif','formation')"))
def downgrade():
op.execute(sa.text("UPDATE interventions SET workflow_type='corrective' WHERE workflow_type IN ('preventive','travaux','prevention')"))