-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent delete volumes used by VMs (#685)
* Fix: Prevent a store message forget to be executed if the file is already used on a VM. * Fix: Added use case test for removing an already used volume. * Fix: Added new error code to database with a migration --------- Co-authored-by: Andres D. Molins <[email protected]>
- Loading branch information
Showing
5 changed files
with
236 additions
and
2 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
deployment/migrations/versions/0030_9e600f404aa1_add_new_error_code_on_db.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,28 @@ | ||
"""add_new_error_code_on_db | ||
Revision ID: 9e600f404aa1 | ||
Revises: 46f7e55ff55c | ||
Create Date: 2025-01-16 13:51:36.699939 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '9e600f404aa1' | ||
down_revision = '46f7e55ff55c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
""" | ||
INSERT INTO error_codes(code, description) VALUES | ||
(503, 'Cannot forget a used message') | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.execute("DELETE FROM error_codes WHERE code = 503") |
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