forked from bcgov/sbc-pay
-
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.
21597-EFT History Invoice Refund (bcgov#1685)
- Loading branch information
Showing
7 changed files
with
146 additions
and
27 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
pay-api/migrations/versions/2024_08_14_4410b7fc6437_eft_invoice_refund_historical.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,34 @@ | ||
"""Invoice refund support for eft_short_names_historical | ||
Revision ID: 4410b7fc6437 | ||
Revises: 5cb9c5f5896c | ||
Create Date: 2024-08-14 10:42:13.484178 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# 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 = '4410b7fc6437' | ||
down_revision = '5cb9c5f5896c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table('eft_short_names_historical', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('invoice_id', sa.Integer(), nullable=True)) | ||
batch_op.create_index(batch_op.f('ix_eft_short_names_historical_invoice_id'), ['invoice_id'], unique=False) | ||
batch_op.create_foreign_key('eft_short_names_historical_invoice_id_fkey', 'invoices', ['invoice_id'], ['id']) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table('eft_short_names_historical', schema=None) as batch_op: | ||
batch_op.drop_constraint('eft_short_names_historical_invoice_id_fkey', type_='foreignkey') | ||
batch_op.drop_index(batch_op.f('ix_eft_short_names_historical_invoice_id')) | ||
batch_op.drop_column('invoice_id') |
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
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