"""ScoDoc 9.0.5: ajout dept_id sur ItemSuiviTag

Revision ID: d3d92b2d0092
Revises: 017e32eb4773
Create Date: 2021-08-29 20:57:55.564519

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd3d92b2d0092'
down_revision = '017e32eb4773'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('itemsuivi_tags', sa.Column('dept_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_itemsuivi_tags_dept_id'), 'itemsuivi_tags', ['dept_id'], unique=False)
    op.create_foreign_key(None, 'itemsuivi_tags', 'departement', ['dept_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'itemsuivi_tags', type_='foreignkey')
    op.drop_index(op.f('ix_itemsuivi_tags_dept_id'), table_name='itemsuivi_tags')
    op.drop_column('itemsuivi_tags', 'dept_id')
    # ### end Alembic commands ###
