Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/group #10

Merged
merged 20 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""examination model with relationship, scheme, crud, endpoints

Revision ID: 043420d3cabe
Revises: da73f8287221
Create Date: 2023-12-15 11:49:39.453458

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '043420d3cabe'
down_revision = 'da73f8287221'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('examination',
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('examination_user_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('examination_id', sa.Integer(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['examination_id'], ['examination.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('examination_id', 'user_id', name='constraint_examination_user')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('examination_user_association')
op.drop_table('examination')
# ### end Alembic commands ###
36 changes: 36 additions & 0 deletions alembic/versions/12ebaaa6044c_course_tariff_relationship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""course tariff relationship

Revision ID: 12ebaaa6044c
Revises: b6230f9d49dc
Create Date: 2023-12-15 19:02:40.113127

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '12ebaaa6044c'
down_revision = 'b6230f9d49dc'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('course_tariff_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('course_id', sa.Integer(), nullable=True),
sa.Column('tariff_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['course_id'], ['course.id'], ),
sa.ForeignKeyConstraint(['tariff_id'], ['tariff.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('course_id', 'tariff_id', name='constraint_course_tariff')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('course_tariff_association')
# ### end Alembic commands ###
36 changes: 0 additions & 36 deletions alembic/versions/16786c7048d6_added_default_role.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""achievement model with relationship

Revision ID: 3a82c343b806
Revises: 043420d3cabe
Create Date: 2023-12-15 12:15:12.153616

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3a82c343b806'
down_revision = '043420d3cabe'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('achievement',
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('achievement_profile_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('achievement_id', sa.Integer(), nullable=True),
sa.Column('profile_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['achievement_id'], ['achievement.id'], ),
sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('achievement_id', 'profile_id', name='constraint_achievement_profile')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('achievement_profile_association')
op.drop_table('achievement')
# ### end Alembic commands ###
32 changes: 0 additions & 32 deletions alembic/versions/41b55aea7689_choice_fix.py

This file was deleted.

44 changes: 44 additions & 0 deletions alembic/versions/b6230f9d49dc_course_user_relationship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""course user relationship

Revision ID: b6230f9d49dc
Revises: 3a82c343b806
Create Date: 2023-12-15 18:51:03.288013

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'b6230f9d49dc'
down_revision = '3a82c343b806'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('course',
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('course_user_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('course_id', sa.Integer(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['course_id'], ['course.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('course_id', 'user_id', name='constraint_course_user')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('course_user_association')
op.drop_table('course')
# ### end Alembic commands ###
44 changes: 44 additions & 0 deletions alembic/versions/d1e8da8e858b_course_task_relationship.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""course task relationship

Revision ID: d1e8da8e858b
Revises: 12ebaaa6044c
Create Date: 2023-12-15 19:21:08.180548

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd1e8da8e858b'
down_revision = '12ebaaa6044c'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('task',
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('task_course_association',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('task_id', sa.Integer(), nullable=True),
sa.Column('course_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['course_id'], ['course.id'], ),
sa.ForeignKeyConstraint(['task_id'], ['task.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('task_id', 'course_id', name='constraint_task_course')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('task_course_association')
op.drop_table('task')
# ### end Alembic commands ###
32 changes: 0 additions & 32 deletions alembic/versions/d532edc24b0c_username.py

This file was deleted.

Loading