Classer les interventions existantes par workflow
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
This commit is contained in:
parent
30ccee3a2a
commit
d1fef99def
1 changed files with 16 additions and 0 deletions
|
|
@ -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')"))
|
||||
Loading…
Reference in a new issue