add year group and change logic of endpoints
This commit is contained in:
parent
c29c2a9236
commit
82807b7c2e
@ -1,68 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 151d3b6306ec
|
||||
Revises:
|
||||
Create Date: 2022-06-11 07:57:52.389681
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '151d3b6306ec'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('project_supervisors',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||
sa.Column('first_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('last_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('email', sa.String(length=120), nullable=True),
|
||||
sa.Column('limit_group', sa.Integer(), nullable=False),
|
||||
sa.Column('count_groups', sa.Integer(), nullable=False),
|
||||
sa.Column('mode', sa.Boolean(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('email')
|
||||
)
|
||||
op.create_index(op.f('ix_project_supervisors_first_name'), 'project_supervisors', ['first_name'], unique=False)
|
||||
op.create_index(op.f('ix_project_supervisors_last_name'), 'project_supervisors', ['last_name'], unique=False)
|
||||
op.create_table('groups',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||
sa.Column('name', sa.String(length=60), nullable=False),
|
||||
sa.Column('project_supervisor_id', sa.Integer(), nullable=True),
|
||||
sa.Column('points_for_first_term', sa.Integer(), nullable=False),
|
||||
sa.Column('points_for_second_term', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['project_supervisor_id'], ['project_supervisors.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('students',
|
||||
sa.Column('first_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('last_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('email', sa.String(length=120), nullable=True),
|
||||
sa.Column('index', sa.Integer(), nullable=False),
|
||||
sa.Column('group_id', sa.Integer(), nullable=True),
|
||||
sa.Column('mode', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
|
||||
sa.PrimaryKeyConstraint('index'),
|
||||
sa.UniqueConstraint('email')
|
||||
)
|
||||
op.create_index(op.f('ix_students_first_name'), 'students', ['first_name'], unique=False)
|
||||
op.create_index(op.f('ix_students_last_name'), 'students', ['last_name'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_students_last_name'), table_name='students')
|
||||
op.drop_index(op.f('ix_students_first_name'), table_name='students')
|
||||
op.drop_table('students')
|
||||
op.drop_table('groups')
|
||||
op.drop_index(op.f('ix_project_supervisors_last_name'), table_name='project_supervisors')
|
||||
op.drop_index(op.f('ix_project_supervisors_first_name'), table_name='project_supervisors')
|
||||
op.drop_table('project_supervisors')
|
||||
# ### end Alembic commands ###
|
@ -1,64 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 64ad410af362
|
||||
Revises: ceaefb33117e
|
||||
Create Date: 2022-10-27 09:44:53.799889
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '64ad410af362'
|
||||
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),
|
||||
sa.Column('mode', sa.Boolean(), nullable=False),
|
||||
sa.Column('start_date', sa.DateTime(), nullable=True),
|
||||
sa.Column('end_date', sa.DateTime(), nullable=True),
|
||||
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),
|
||||
sa.ForeignKeyConstraint(['enrollment_id'], ['enrollments.id'], ondelete='CASCADE'),
|
||||
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 ###
|
@ -1,34 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: ceaefb33117e
|
||||
Revises: 151d3b6306ec
|
||||
Create Date: 2022-06-12 17:43:24.714877
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ceaefb33117e'
|
||||
down_revision = '151d3b6306ec'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('groups', sa.Column('cdyd_kod', sa.String(length=60), nullable=True))
|
||||
op.add_column('groups', sa.Column('prz_kod', sa.String(length=60), nullable=True))
|
||||
op.add_column('groups', sa.Column('tzaj_kod', sa.String(length=60), nullable=True))
|
||||
op.add_column('students', sa.Column('pesel', sa.String(length=11), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('students', 'pesel')
|
||||
op.drop_column('groups', 'tzaj_kod')
|
||||
op.drop_column('groups', 'prz_kod')
|
||||
op.drop_column('groups', 'cdyd_kod')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue
Block a user