"""Ajoute l'origine fonctionnelle des interventions."""
from alembic import op
import sqlalchemy as sa

revision = "ff6a7b8c9d0e"
down_revision = "fe5f6a7b8c9d"
branch_labels = None
depends_on = None

def upgrade():
    op.add_column("interventions", sa.Column("workflow_type", sa.String(20), nullable=False, server_default="corrective"))
    op.create_index("ix_interventions_workflow_type", "interventions", ["workflow_type"])

def downgrade():
    op.drop_index("ix_interventions_workflow_type", table_name="interventions")
    op.drop_column("interventions", "workflow_type")
