-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'game-api-v1' into backend
- Loading branch information
Showing
26 changed files
with
381 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../migrations/versions/2023_11_19_0024-da06417476fd_меняет_в_модели_уровня_name_на_title.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""меняет в модели уровня name на title | ||
Revision ID: da06417476fd | ||
Revises: 29ed19cdffbf | ||
Create Date: 2023-11-19 00:24:59.794292 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'da06417476fd' | ||
down_revision: Union[str, None] = '29ed19cdffbf' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('levels', sa.Column('title', sa.String(length=255), nullable=False)) | ||
op.alter_column('levels', 'module_id', | ||
existing_type=sa.UUID(), | ||
nullable=True) | ||
op.drop_column('levels', 'name') | ||
op.alter_column('modules', 'map_id', | ||
existing_type=sa.UUID(), | ||
nullable=True) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('modules', 'map_id', | ||
existing_type=sa.UUID(), | ||
nullable=False) | ||
op.add_column('levels', sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False)) | ||
op.alter_column('levels', 'module_id', | ||
existing_type=sa.UUID(), | ||
nullable=False) | ||
op.drop_column('levels', 'title') | ||
# ### end Alembic commands ### |
32 changes: 32 additions & 0 deletions
32
...migrations/versions/2023_11_19_0049-5bbffa09568b_меняет_в_модели_теории_theme_на_title.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""меняет в модели теории theme на title | ||
Revision ID: 5bbffa09568b | ||
Revises: da06417476fd | ||
Create Date: 2023-11-19 00:49:49.197801 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '5bbffa09568b' | ||
down_revision: Union[str, None] = 'da06417476fd' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('theory_blocks', sa.Column('title', sa.String(), nullable=False)) | ||
op.drop_column('theory_blocks', 'theme') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('theory_blocks', sa.Column('theme', sa.VARCHAR(), autoincrement=False, nullable=False)) | ||
op.drop_column('theory_blocks', 'title') | ||
# ### end Alembic commands ### |
36 changes: 36 additions & 0 deletions
36
...rations/versions/2023_11_19_1035-43a526a12009_добавляет_связь_между_задачей_и_ответами.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""добавляет связь между задачей и ответами | ||
Revision ID: 43a526a12009 | ||
Revises: 5bbffa09568b | ||
Create Date: 2023-11-19 10:35:20.123826 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '43a526a12009' | ||
down_revision: Union[str, None] = '5bbffa09568b' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('questions', sa.Column('task_id', sa.UUID(), nullable=True)) | ||
op.create_foreign_key(None, 'questions', 'tasks', ['task_id'], ['id']) | ||
op.add_column('tasks', sa.Column('level_id', sa.UUID(), nullable=True)) | ||
op.create_foreign_key(None, 'tasks', 'levels', ['level_id'], ['id']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'tasks', type_='foreignkey') | ||
op.drop_column('tasks', 'level_id') | ||
op.drop_constraint(None, 'questions', type_='foreignkey') | ||
op.drop_column('questions', 'task_id') | ||
# ### end Alembic commands ### |
30 changes: 30 additions & 0 deletions
30
...nd/migrations/versions/2023_11_19_1037-e21d5fb84a66_добавляет_связь_между_вопросами_и_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""добавляет связь между вопросами и ответами | ||
Revision ID: e21d5fb84a66 | ||
Revises: 43a526a12009 | ||
Create Date: 2023-11-19 10:37:12.398132 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'e21d5fb84a66' | ||
down_revision: Union[str, None] = '43a526a12009' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_foreign_key(None, 'answers', 'questions', ['question_id'], ['id']) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'answers', type_='foreignkey') | ||
# ### end Alembic commands ### |
36 changes: 36 additions & 0 deletions
36
...grations/versions/2023_11_19_1048-e8496d8a36fc_временно_удаляет_таблицу_с_видео_теории.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""временно удаляет таблицу с видео теории | ||
Revision ID: e8496d8a36fc | ||
Revises: e21d5fb84a66 | ||
Create Date: 2023-11-19 10:48:35.457329 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'e8496d8a36fc' | ||
down_revision: Union[str, None] = 'e21d5fb84a66' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('theory_videos') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('theory_videos', | ||
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False), | ||
sa.Column('theory_id', sa.UUID(), autoincrement=False, nullable=False), | ||
sa.Column('url', sa.TEXT(), autoincrement=False, nullable=False), | ||
sa.ForeignKeyConstraint(['theory_id'], ['theory_blocks.id'], name='theory_videos_theory_id_fkey'), | ||
sa.PrimaryKeyConstraint('id', name='theory_videos_pkey') | ||
) | ||
# ### end Alembic commands ### |
40 changes: 40 additions & 0 deletions
40
...rations/versions/2023_11_19_2146-4e3cf7a2acb2_модуль_и_уровни_обязательно_привязаны_к_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""модуль и уровни обязательно привязаны к родителю | ||
Revision ID: 4e3cf7a2acb2 | ||
Revises: e8496d8a36fc | ||
Create Date: 2023-11-19 21:46:34.041826 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '4e3cf7a2acb2' | ||
down_revision: Union[str, None] = 'e8496d8a36fc' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('levels', 'module_id', | ||
existing_type=sa.UUID(), | ||
nullable=False) | ||
op.alter_column('modules', 'map_id', | ||
existing_type=sa.UUID(), | ||
nullable=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('modules', 'map_id', | ||
existing_type=sa.UUID(), | ||
nullable=True) | ||
op.alter_column('levels', 'module_id', | ||
existing_type=sa.UUID(), | ||
nullable=True) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from enum import auto, Enum | ||
|
||
|
||
class LevelStates(Enum): | ||
NotViewed = auto() | ||
Viewed = auto() | ||
Completed = auto() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.