2022-12-19 21:32:45 +01:00
|
|
|
"""Ajout Modeles Assiduites Justificatifs
|
2022-11-03 10:29:30 +01:00
|
|
|
|
2022-12-19 21:32:45 +01:00
|
|
|
Revision ID: 530594458193
|
|
|
|
Revises: f95656fdd3ef
|
|
|
|
Create Date: 2022-12-19 13:56:28.597632
|
2022-11-03 10:29:30 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2022-12-19 21:32:45 +01:00
|
|
|
revision = '530594458193'
|
|
|
|
down_revision = 'f95656fdd3ef'
|
2022-11-03 10:29:30 +01:00
|
|
|
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.Integer(), 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 ###
|