DocScoDoc/migrations/versions/ada0d1f3d84f_but_poids_evaluations_ac.py

65 lines
1.7 KiB
Python

"""BUT: poids evaluations, AC
Revision ID: ada0d1f3d84f
Revises: 75cf18659984
Create Date: 2021-11-07 22:49:22.697211
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "ada0d1f3d84f"
down_revision = "75cf18659984"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"app_crit",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("code", sa.Text(), nullable=False),
sa.Column("titre", sa.Text(), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"modules_acs",
sa.Column("module_id", sa.Integer(), nullable=True),
sa.Column("ac_id", sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(
["ac_id"],
["app_crit.id"],
),
sa.ForeignKeyConstraint(
["module_id"],
["notes_modules.id"],
),
)
op.create_table(
"evaluation_ue_poids",
sa.Column("evaluation_id", sa.Integer(), nullable=False),
sa.Column("ue_id", sa.Integer(), nullable=False),
sa.Column("poids", sa.Float(), nullable=False),
sa.ForeignKeyConstraint(
["evaluation_id"],
["notes_evaluation.id"],
),
sa.ForeignKeyConstraint(
["ue_id"],
["notes_ue.id"],
),
sa.PrimaryKeyConstraint("evaluation_id", "ue_id"),
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("evaluation_ue_poids")
op.drop_table("modules_acs")
op.drop_table("app_crit")
# ### end Alembic commands ###