2021-09-10 21:48:04 +02:00
|
|
|
"""ScoDoc 9.0.13: essai cascade
|
|
|
|
|
|
|
|
Revision ID: a217bf588f4c
|
|
|
|
Revises: f73251d1d825
|
|
|
|
Create Date: 2021-09-10 21:44:34.947317
|
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2022-05-09 16:26:23 +02:00
|
|
|
revision = "a217bf588f4c"
|
|
|
|
down_revision = "f73251d1d825"
|
2021-09-10 21:48:04 +02:00
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2022-05-09 16:26:23 +02:00
|
|
|
op.alter_column(
|
|
|
|
"notes_semset_formsemestre",
|
|
|
|
"semset_id",
|
|
|
|
existing_type=sa.INTEGER(),
|
|
|
|
nullable=False,
|
|
|
|
)
|
|
|
|
op.drop_constraint(
|
|
|
|
"notes_semset_formsemestre_semset_id_fkey",
|
|
|
|
"notes_semset_formsemestre",
|
|
|
|
type_="foreignkey",
|
|
|
|
)
|
|
|
|
op.create_foreign_key(
|
|
|
|
None,
|
|
|
|
"notes_semset_formsemestre",
|
|
|
|
"notes_semset",
|
|
|
|
["semset_id"],
|
|
|
|
["id"],
|
|
|
|
ondelete="CASCADE",
|
|
|
|
)
|
2021-09-10 21:48:04 +02:00
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
2022-05-09 16:26:23 +02:00
|
|
|
op.drop_constraint(None, "notes_semset_formsemestre", type_="foreignkey")
|
|
|
|
op.create_foreign_key(
|
|
|
|
"notes_semset_formsemestre_semset_id_fkey",
|
|
|
|
"notes_semset_formsemestre",
|
|
|
|
"notes_semset",
|
|
|
|
["semset_id"],
|
|
|
|
["id"],
|
|
|
|
)
|
|
|
|
op.alter_column(
|
|
|
|
"notes_semset_formsemestre",
|
|
|
|
"semset_id",
|
|
|
|
existing_type=sa.INTEGER(),
|
|
|
|
nullable=True,
|
|
|
|
)
|
2021-09-10 21:48:04 +02:00
|
|
|
# ### end Alembic commands ###
|