-
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.
Fix: Added new error code to database with a migration
- Loading branch information
Andres D. Molins
committed
Jan 16, 2025
1 parent
0ce7e0d
commit 00534e0
Showing
1 changed file
with
28 additions
and
0 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") |