-
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.
Introduce deleted status to fix dismissed requests behaviour (#123)
* introduce deleted status * qa * qa
- Loading branch information
1 parent
ca55b34
commit aa53cac
Showing
5 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
alembic/versions/a4e8be715296_add_deleted_as_new_status.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,53 @@ | ||
"""add deleted as new status. | ||
Revision ID: a4e8be715296 | ||
Revises: d5d4afc97d40 | ||
Create Date: 2024-07-25 13:13:11.955119 | ||
""" | ||
|
||
from sqlalchemy.dialects.postgresql import ENUM | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "a4e8be715296" | ||
down_revision = "d5d4afc97d40" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
old_status_enum = ENUM( | ||
"pending", "in_progress", "completed", "failed", name="status", create_type=False | ||
) | ||
new_status_enum = ENUM( | ||
"pending", | ||
"in_progress", | ||
"completed", | ||
"failed", | ||
"deleted", | ||
name="status", | ||
create_type=False, | ||
) | ||
|
||
|
||
def upgrade() -> None: | ||
# Add the new status to the enum | ||
op.alter_column( | ||
"system_requests", | ||
"status", | ||
existing_type=old_status_enum, | ||
type_=new_status_enum, | ||
existing_nullable=False, | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
# Remove the new status from the enum | ||
op.alter_column( | ||
"system_requests", | ||
"status", | ||
existing_type=new_status_enum, | ||
type_=old_status_enum, | ||
existing_nullable=False, | ||
) |
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