MonScoDocEssai/migrations/versions/814e8e37d082_unicite_dept_acronym.py

33 lines
883 B
Python
Raw Normal View History

2022-08-04 16:10:11 +02:00
"""unicite dept_acronym
Revision ID: 814e8e37d082
Revises: 57179ae34069
Create Date: 2022-08-04 16:07:59.710487
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "814e8e37d082"
down_revision = "57179ae34069"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index("ix_departement_acronym", table_name="departement")
op.create_index(
op.f("ix_departement_acronym"), "departement", ["acronym"], unique=True
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_departement_acronym"), table_name="departement")
op.create_index("ix_departement_acronym", "departement", ["acronym"], unique=False)
# ### end Alembic commands ###