-
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 #24 from cs3216-a3-group-4/seeleng/edit-event-routes
feat: update event routes
- Loading branch information
Showing
8 changed files
with
275 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
"""move table back | ||
Revision ID: 37cf2356fe08 | ||
Revises: c3b7f848f6f3 | ||
Create Date: 2024-09-23 01:20:37.025966 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "37cf2356fe08" | ||
down_revision: Union[str, None] = "c3b7f848f6f3" | ||
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( | ||
"analysis", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("event_id", sa.Integer(), nullable=False), | ||
sa.Column("category_id", sa.Integer(), nullable=False), | ||
sa.Column("content", sa.String(), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["category_id"], | ||
["category.id"], | ||
), | ||
sa.ForeignKeyConstraint( | ||
["event_id"], | ||
["event.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.drop_table("analysis1") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"analysis1", | ||
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False), | ||
sa.Column("event_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
sa.Column("category_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
sa.Column("content", sa.VARCHAR(), autoincrement=False, nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["category_id"], ["category.id"], name="analysis1_category_id_fkey" | ||
), | ||
sa.ForeignKeyConstraint( | ||
["event_id"], ["event.id"], name="analysis1_event_id_fkey" | ||
), | ||
sa.PrimaryKeyConstraint("id", name="analysis1_pkey"), | ||
) | ||
op.drop_table("analysis") | ||
# ### end Alembic commands ### |
31 changes: 31 additions & 0 deletions
31
backend/alembic/versions/90baf2b50ff3_add_id_to_analysis.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,31 @@ | ||
"""Add id to analysis | ||
Revision ID: 90baf2b50ff3 | ||
Revises: bc5fcbe47713 | ||
Create Date: 2024-09-23 00:55:33.251027 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "90baf2b50ff3" | ||
down_revision: Union[str, None] = "bc5fcbe47713" | ||
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("analysis", sa.Column("id", sa.Integer(), nullable=False)),) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("analysis", "id") | ||
# ### end Alembic commands ### |
61 changes: 61 additions & 0 deletions
61
backend/alembic/versions/c3b7f848f6f3_move_table_temporarily.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,61 @@ | ||
"""move table temporarily | ||
Revision ID: c3b7f848f6f3 | ||
Revises: ddf34f03e551 | ||
Create Date: 2024-09-23 01:20:21.380233 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "c3b7f848f6f3" | ||
down_revision: Union[str, None] = "ddf34f03e551" | ||
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( | ||
"analysis1", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("event_id", sa.Integer(), nullable=False), | ||
sa.Column("category_id", sa.Integer(), nullable=False), | ||
sa.Column("content", sa.String(), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["category_id"], | ||
["category.id"], | ||
), | ||
sa.ForeignKeyConstraint( | ||
["event_id"], | ||
["event.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.drop_table("analysis") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"analysis", | ||
sa.Column("event_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
sa.Column("category_id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
sa.Column("content", sa.VARCHAR(), autoincrement=False, nullable=False), | ||
sa.Column("id", sa.INTEGER(), autoincrement=False, nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["category_id"], ["category.id"], name="analysis_category_id_fkey" | ||
), | ||
sa.ForeignKeyConstraint( | ||
["event_id"], ["event.id"], name="analysis_event_id_fkey" | ||
), | ||
sa.PrimaryKeyConstraint("id", name="analysis_pkey"), | ||
) | ||
op.drop_table("analysis1") | ||
# ### end Alembic commands ### |
31 changes: 31 additions & 0 deletions
31
backend/alembic/versions/ddf34f03e551_make_id_in_analysis_actually_pk.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,31 @@ | ||
"""make id in analysis actually pk | ||
Revision ID: ddf34f03e551 | ||
Revises: 90baf2b50ff3 | ||
Create Date: 2024-09-23 01:08:01.468695 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "ddf34f03e551" | ||
down_revision: Union[str, None] = "90baf2b50ff3" | ||
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.execute("ALTER TABLE analysis DROP CONSTRAINT analysis_pkey CASCADE") | ||
op.create_primary_key("analysis_pkey", "analysis", ["id"]) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### 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
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.