-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration to fix error message. (#927)
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
pay-api/migrations/versions/175c11863186_fix_rs_cant_link_nsf_description.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,57 @@ | ||
"""fix RS_CANT_LINK_NSF description | ||
Revision ID: 175c11863186 | ||
Revises: 2ccbd2aad2dc | ||
Create Date: 2022-05-03 16:06:42.663506 | ||
""" | ||
from alembic import op | ||
from sqlalchemy import String | ||
from sqlalchemy.sql import column, table | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '175c11863186' | ||
down_revision = '2ccbd2aad2dc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Delete existing code. | ||
op.execute("DELETE FROM error_codes where code in ('RS_CANT_LINK_NSF')") | ||
error_code_table = table('error_codes', | ||
column('code', String), | ||
column('title', String), | ||
column('detail', String) | ||
) | ||
|
||
op.bulk_insert( | ||
error_code_table, | ||
[ | ||
{ | ||
'code': 'RS_CANT_LINK_NSF', | ||
'title': 'Routing Slip cannot be linked.', | ||
'detail': 'Linking cannot be performed since the Routing slip is NSF.' | ||
} | ||
]) | ||
|
||
|
||
def downgrade(): | ||
# Delete existing code. | ||
op.execute("DELETE FROM error_codes where code in ('RS_CANT_LINK_NSF')") | ||
error_code_table = table('error_codes', | ||
column('code', String), | ||
column('title', String), | ||
column('detail', String) | ||
) | ||
|
||
op.bulk_insert( | ||
error_code_table, | ||
[ | ||
{ | ||
'code': 'RS_CANT_LINK_NSF', | ||
'title': 'Routing Slip cannot be linked.', | ||
'detail': 'Linking cannot be performed since the routing slip is NSF. It can only be linked to.' | ||
} | ||
]) |