ScoDoc/migrations/versions/829683efddc4_change_apcvalidationannee.py

45 lines
1.3 KiB
Python

"""Change ApcValidationAnnee
Revision ID: 829683efddc4
Revises: c701224fa255
Create Date: 2023-06-28 09:47:16.591028
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "829683efddc4"
down_revision = "c701224fa255"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("apc_validation_annee", schema=None) as batch_op:
batch_op.drop_constraint(
"apc_validation_annee_etudid_annee_scolaire_ordre_key", type_="unique"
)
# batch_op.create_unique_constraint(
# "apc_validation_annee_etudid_formation_ordre_key",
# ["etudid", "ordre", "formation_id"],
# )
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("apc_validation_annee", schema=None) as batch_op:
# batch_op.drop_constraint(
# "apc_validation_annee_etudid_formation_ordre_key", type_="unique"
# )
batch_op.create_unique_constraint(
"apc_validation_annee_etudid_annee_scolaire_ordre_key",
["etudid", "annee_scolaire", "ordre"],
)
# ### end Alembic commands ###