2022-10-26 10:33:35 +02:00
|
|
|
"""empty message
|
|
|
|
|
2022-10-26 15:11:50 +02:00
|
|
|
Revision ID: 97c55960cd98
|
2022-10-26 10:33:35 +02:00
|
|
|
Revises: ceaefb33117e
|
2022-10-26 15:11:50 +02:00
|
|
|
Create Date: 2022-10-26 13:00:18.439990
|
2022-10-26 10:33:35 +02:00
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2022-10-26 15:11:50 +02:00
|
|
|
revision = '97c55960cd98'
|
2022-10-26 10:33:35 +02:00
|
|
|
down_revision = 'ceaefb33117e'
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.create_table('examination_schedules',
|
|
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
|
|
sa.Column('title', sa.String(length=100), nullable=False),
|
2022-10-26 12:41:22 +02:00
|
|
|
sa.Column('start_date', sa.DateTime(), nullable=True),
|
|
|
|
sa.Column('end_date', sa.DateTime(), nullable=True),
|
2022-10-26 10:33:35 +02:00
|
|
|
sa.PrimaryKeyConstraint('id'),
|
|
|
|
sa.UniqueConstraint('title')
|
|
|
|
)
|
|
|
|
op.create_table('enrollments',
|
|
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
|
|
sa.Column('start_date', sa.DateTime(), nullable=False),
|
|
|
|
sa.Column('end_date', sa.DateTime(), nullable=False),
|
|
|
|
sa.Column('examination_schedule_id', sa.Integer(), nullable=True),
|
|
|
|
sa.Column('group_id', sa.Integer(), nullable=True),
|
|
|
|
sa.ForeignKeyConstraint(['examination_schedule_id'], ['examination_schedules.id'], ),
|
|
|
|
sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
|
|
|
|
sa.PrimaryKeyConstraint('id')
|
|
|
|
)
|
|
|
|
op.create_table('committees',
|
|
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
|
|
sa.Column('enrollment_id', sa.Integer(), nullable=True),
|
2022-10-26 15:11:50 +02:00
|
|
|
sa.ForeignKeyConstraint(['enrollment_id'], ['enrollments.id'], ondelete='CASCADE'),
|
2022-10-26 10:33:35 +02:00
|
|
|
sa.PrimaryKeyConstraint('id')
|
|
|
|
)
|
|
|
|
op.create_table('committees_projects_supervisors',
|
|
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
|
|
sa.Column('chairman', sa.Boolean(), nullable=False),
|
|
|
|
sa.Column('committee_id', sa.Integer(), nullable=True),
|
|
|
|
sa.Column('member_id', sa.Integer(), nullable=True),
|
|
|
|
sa.ForeignKeyConstraint(['committee_id'], ['committees.id'], ),
|
|
|
|
sa.ForeignKeyConstraint(['member_id'], ['project_supervisors.id'], ),
|
|
|
|
sa.PrimaryKeyConstraint('id')
|
|
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.drop_table('committees_projects_supervisors')
|
|
|
|
op.drop_table('committees')
|
|
|
|
op.drop_table('enrollments')
|
|
|
|
op.drop_table('examination_schedules')
|
|
|
|
# ### end Alembic commands ###
|