-
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 'master' of https://github.com/cf15-t5/seticket-backend
- Loading branch information
Showing
14 changed files
with
108 additions
and
16 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
migrations/versions/199b40c274e7_alter_table_add_status_change_at_on_.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 @@ | ||
"""alter_table_add_status_change_at_on_event_table | ||
Revision ID: 199b40c274e7 | ||
Revises: f391490d3fa9 | ||
Create Date: 2023-08-26 18:08:17.283643 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '199b40c274e7' | ||
down_revision = 'f391490d3fa9' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('events', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('status_change_at', sa.DateTime(), nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('events', schema=None) as batch_op: | ||
batch_op.drop_column('status_change_at') | ||
|
||
# ### end Alembic commands ### |
42 changes: 42 additions & 0 deletions
42
migrations/versions/21069897ab61_alter_table_add_ondelte_cascade_for_.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 @@ | ||
"""alter_table_add_ondelte_cascade_for_event_ticket_table | ||
Revision ID: 21069897ab61 | ||
Revises: 199b40c274e7 | ||
Create Date: 2023-08-26 18:39:02.825930 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '21069897ab61' | ||
down_revision = '199b40c274e7' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('tickets', schema=None) as batch_op: | ||
batch_op.drop_constraint('tickets_ibfk_1', type_='foreignkey') | ||
batch_op.create_foreign_key(None, 'events', ['event_id'], ['event_id'], ondelete='CASCADE') | ||
|
||
with op.batch_alter_table('transactions', schema=None) as batch_op: | ||
batch_op.drop_constraint('transactions_ibfk_1', type_='foreignkey') | ||
batch_op.create_foreign_key(None, 'tickets', ['ticket_id'], ['ticket_id'], ondelete='CASCADE') | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('transactions', schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_='foreignkey') | ||
batch_op.create_foreign_key('transactions_ibfk_1', 'tickets', ['ticket_id'], ['ticket_id']) | ||
|
||
with op.batch_alter_table('tickets', schema=None) as batch_op: | ||
batch_op.drop_constraint(None, type_='foreignkey') | ||
batch_op.create_foreign_key('tickets_ibfk_1', 'events', ['event_id'], ['event_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
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
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