-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
pay-api/migrations/versions/2024_10_31_5fa0fea09841_set_routing_slip_status_again.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,31 @@ | ||
"""Small fix that changes routing slip statuses next time this migration hits prod. | ||
We had to deploy main to prod to fix another issue. | ||
Revision ID: 5fa0fea09841 | ||
Revises: c76e8338de35 | ||
Create Date: 2024-10-31 15:40:04.636234 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from pay_api.utils.enums import RoutingSlipStatus | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
# Note you may see foreign keys with distribution_codes_history | ||
# For disbursement_distribution_code_id, service_fee_distribution_code_id | ||
# Please ignore those lines and don't include in migration. | ||
|
||
revision = '5fa0fea09841' | ||
down_revision = 'c76e8338de35' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute(f"update routing_slips set status = '{RoutingSlipStatus.REFUND_PROCESSED.value}' where status = 'REFUND_COMPLETED';") | ||
op.execute("delete from routing_slip_status_codes where code = 'REFUND_COMPLETED';") | ||
|
||
def downgrade(): | ||
op.execute("INSERT INTO routing_slip_status_codes (code, description) VALUES ('REFUND_COMPLETED', 'Refund Complete');") | ||
op.execute(f"update routing_slips set status = 'REFUND_COMPLETED' where status = '{RoutingSlipStatus.REFUND_PROCESSED.value}';") |