From 15340dad6a6b09cc669b840f585115a224a022f2 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 16 Sep 2023 15:48:35 -0500 Subject: [PATCH] Add `tender_code` for CORE equity import batch rows --- ...f04546a59_add_equity_import_tender_code.py | 31 +++++++++++++++++++ .../db/model/batch/equityimport.py | 1 + 2 files changed, 32 insertions(+) create mode 100644 rattail_corepos/db/alembic/versions/f8df04546a59_add_equity_import_tender_code.py diff --git a/rattail_corepos/db/alembic/versions/f8df04546a59_add_equity_import_tender_code.py b/rattail_corepos/db/alembic/versions/f8df04546a59_add_equity_import_tender_code.py new file mode 100644 index 0000000..baabd94 --- /dev/null +++ b/rattail_corepos/db/alembic/versions/f8df04546a59_add_equity_import_tender_code.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8; -*- +"""add equity_import tender_code + +Revision ID: f8df04546a59 +Revises: d426a274f0c2 +Create Date: 2023-09-16 15:38:25.569334 + +""" + +# revision identifiers, used by Alembic. +revision = 'f8df04546a59' +down_revision = 'd426a274f0c2' +branch_labels = None +depends_on = None + +from alembic import op +import sqlalchemy as sa +import rattail.db.types + + + +def upgrade(): + + # batch_corepos_equity_import_row + op.add_column('batch_corepos_equity_import_row', sa.Column('tender_code', sa.String(length=2), nullable=True)) + + +def downgrade(): + + # batch_corepos_equity_import_row + op.drop_column('batch_corepos_equity_import_row', 'tender_code') diff --git a/rattail_corepos/db/model/batch/equityimport.py b/rattail_corepos/db/model/batch/equityimport.py index 3771bf4..e9d215b 100644 --- a/rattail_corepos/db/model/batch/equityimport.py +++ b/rattail_corepos/db/model/batch/equityimport.py @@ -92,6 +92,7 @@ class CoreEquityImportBatchRow(model.BatchRowMixin, model.Base): member_type_id = sa.Column(sa.Integer(), nullable=True) payment_amount = sa.Column(sa.Numeric(precision=10, scale=2), nullable=True) department_number = sa.Column(sa.Integer(), nullable=True) + tender_code = sa.Column(sa.String(length=2), nullable=True) timestamp = sa.Column(sa.DateTime(), nullable=True) corepos_equity_total = sa.Column(sa.Numeric(precision=10, scale=2), nullable=True) rattail_equity_total = sa.Column(sa.Numeric(precision=10, scale=2), nullable=True)