-
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 pull request #101 from cs3216-a3-group-4/seeleng/modify-user-qu…
…estions-backend feat: add fallback and change format of user-questions routes
- Loading branch information
Showing
6 changed files
with
244 additions
and
50 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
backend/alembic/versions/65b186bae301_add_fallback_table.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,42 @@ | ||
"""Add fallback table | ||
Revision ID: 65b186bae301 | ||
Revises: c1022b3f1de5 | ||
Create Date: 2024-09-27 01:37:55.705475 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "65b186bae301" | ||
down_revision: Union[str, None] = "c1022b3f1de5" | ||
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_table( | ||
"fallback", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("point_id", sa.Integer(), nullable=False), | ||
sa.Column("alt_approach", sa.String(), nullable=False), | ||
sa.Column("general_argument", sa.String(), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["point_id"], | ||
["point.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("fallback") | ||
# ### end Alembic commands ### |
35 changes: 35 additions & 0 deletions
35
backend/alembic/versions/951ac4411b0d_add_elaboration_for_third_layer.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,35 @@ | ||
"""Add elaboration for third layer | ||
Revision ID: 951ac4411b0d | ||
Revises: feeb1c78c0a2 | ||
Create Date: 2024-09-26 21:39:24.431100 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "951ac4411b0d" | ||
down_revision: Union[str, None] = "feeb1c78c0a2" | ||
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("point", sa.Column("positive", sa.Boolean(), nullable=False)) | ||
op.add_column( | ||
"point_analysis", sa.Column("elaboration", sa.String(), nullable=False) | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("point_analysis", "elaboration") | ||
op.drop_column("point", "positive") | ||
# ### 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""empty message | ||
Revision ID: c1022b3f1de5 | ||
Revises: 7f60f0211af1, 951ac4411b0d | ||
Create Date: 2024-09-27 01:37:39.117941 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "c1022b3f1de5" | ||
down_revision: Union[str, None] = ("7f60f0211af1", "951ac4411b0d") | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
pass | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
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