-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/WiiLink24/room-server
- Loading branch information
Showing
19 changed files
with
389 additions
and
54 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
migrations/versions/6ebdcbc733bf_add_second_primary_key_to_roommiis.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,37 @@ | ||
"""Add second primary_key to RoomMiis | ||
Revision ID: 6ebdcbc733bf | ||
Revises: 4b7420e6c104 | ||
Create Date: 2024-07-04 22:31:59.115483 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "6ebdcbc733bf" | ||
down_revision = "4b7420e6c104" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.alter_column("room_id", existing_type=sa.INTEGER(), nullable=False) | ||
batch_op.drop_constraint("room_miis_room_id_key", type_="unique") | ||
batch_op.create_unique_constraint(None, ["mii_id"]) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_="unique") | ||
batch_op.create_unique_constraint("room_miis_room_id_key", ["room_id"]) | ||
batch_op.alter_column("room_id", existing_type=sa.INTEGER(), nullable=False) | ||
|
||
# ### end Alembic commands ### |
33 changes: 33 additions & 0 deletions
33
migrations/versions/b21847b05808_make_mii_id_the_primary_key_for_room_.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,33 @@ | ||
"""Make Mii ID the primary key for Room Miis | ||
Revision ID: b21847b05808 | ||
Revises: e40c6d93a515 | ||
Create Date: 2024-07-04 22:37:35.247186 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b21847b05808" | ||
down_revision = "e40c6d93a515" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.drop_constraint("room_miis_room_id_key", type_="unique") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.create_unique_constraint("room_miis_room_id_key", ["room_id"]) | ||
|
||
# ### 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,41 @@ | ||
"""Add seq to RoomMiis | ||
Revision ID: da8e2f3e9887 | ||
Revises: b21847b05808 | ||
Create Date: 2024-07-04 22:41:48.173083 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "da8e2f3e9887" | ||
down_revision = "b21847b05808" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("seq", sa.Integer())) | ||
|
||
op.execute("UPDATE room_miis SET seq = 1") | ||
op.alter_column( | ||
"room_miis", | ||
"seq", | ||
existing_type=sa.Integer(), | ||
nullable=False, | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.drop_column("seq") | ||
|
||
# ### end Alembic commands ### |
33 changes: 33 additions & 0 deletions
33
migrations/versions/e40c6d93a515_double_primary_key_for_roommiis.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,33 @@ | ||
"""Double primary key for RoomMiis | ||
Revision ID: e40c6d93a515 | ||
Revises: 6ebdcbc733bf | ||
Create Date: 2024-07-04 22:34:30.018315 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "e40c6d93a515" | ||
down_revision = "6ebdcbc733bf" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.create_unique_constraint(None, ["room_id"]) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("room_miis", schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_="unique") | ||
|
||
# ### 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
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
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.