From 1fa8375b11df5c4fc18c269a33adf952c29a41d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 1 Dec 2022 13:00:14 +0100 Subject: [PATCH] =?UTF-8?q?BUT:=20dispenses=20d'UE=20capitalis=C3=A9es.=20?= =?UTF-8?q?Voir=20#537.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._ajout_modeles_assiduites_justificatifs.py | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 migrations/versions/685fe5c55439_ajout_modeles_assiduites_justificatifs.py diff --git a/migrations/versions/685fe5c55439_ajout_modeles_assiduites_justificatifs.py b/migrations/versions/685fe5c55439_ajout_modeles_assiduites_justificatifs.py new file mode 100644 index 00000000..02ae2448 --- /dev/null +++ b/migrations/versions/685fe5c55439_ajout_modeles_assiduites_justificatifs.py @@ -0,0 +1,82 @@ +"""Ajout Modeles Assiduites Justificatifs + +Revision ID: 685fe5c55439 +Revises: 3c12f5850cff +Create Date: 2022-12-26 09:00:54.750859 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "685fe5c55439" +down_revision = "3c12f5850cff" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "justificatifs", + sa.Column("justifid", sa.Integer(), nullable=False), + sa.Column( + "date_debut", + sa.DateTime(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column( + "date_fin", + sa.DateTime(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column("etudid", sa.Integer(), nullable=False), + sa.Column("etat", sa.Integer(), nullable=True), + sa.Column("raison", sa.Text(), nullable=True), + sa.Column("fichier", sa.Date(), nullable=True), + sa.ForeignKeyConstraint(["etudid"], ["identite.id"], ondelete="CASCADE"), + sa.PrimaryKeyConstraint("justifid"), + ) + op.create_index( + op.f("ix_justificatifs_etudid"), "justificatifs", ["etudid"], unique=False + ) + op.create_table( + "assiduites", + sa.Column("id", sa.Integer(), nullable=False), + sa.Column( + "date_debut", + sa.DateTime(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column( + "date_fin", + sa.DateTime(timezone=True), + server_default=sa.text("now()"), + nullable=False, + ), + sa.Column("moduleimpl_id", sa.Integer(), nullable=True), + sa.Column("etudid", sa.Integer(), nullable=False), + sa.Column("etat", sa.Integer(), nullable=False), + sa.ForeignKeyConstraint(["etudid"], ["identite.id"], ondelete="CASCADE"), + sa.ForeignKeyConstraint( + ["moduleimpl_id"], ["notes_moduleimpl.id"], ondelete="SET NULL" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + op.f("ix_assiduites_etudid"), "assiduites", ["etudid"], unique=False + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f("ix_assiduites_etudid"), table_name="assiduites") + op.drop_table("assiduites") + op.drop_index(op.f("ix_justificatifs_etudid"), table_name="justificatifs") + op.drop_table("justificatifs") + # ### end Alembic commands ###