Changeset - dcd5ef9819a4
[Not reviewed]
0 1 1
Lance Edgar (lance) - 2 months ago 2024-08-13 11:12:01
lance@edbob.org
fix: grow column size for `MemberEquityPayment.amount`

to match CORE-POS `stockpurchases` table, otherwise it's possible to
fail importing that data
2 files changed with 46 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rattail/db/alembic/versions/b9d58e803208_grow_equity_payment_amount.py
Show inline comments
 
new file 100644
 
# -*- coding: utf-8; -*-
 
"""grow equity payment amount
 

	
 
Revision ID: b9d58e803208
 
Revises: f6e95c74d8db
 
Create Date: 2024-08-13 10:59:47.778670
 

	
 
"""
 

	
 
# revision identifiers, used by Alembic.
 
revision = 'b9d58e803208'
 
down_revision = 'f6e95c74d8db'
 
branch_labels = None
 
depends_on = None
 

	
 
from alembic import op
 
import sqlalchemy as sa
 
import rattail.db.types
 

	
 

	
 

	
 
def upgrade():
 

	
 
    # member_equity_payment
 
    op.alter_column('member_equity_payment', 'amount',
 
               existing_type=sa.NUMERIC(precision=7, scale=2),
 
               type_=sa.Numeric(precision=10, scale=2),
 
               existing_nullable=False)
 
    op.alter_column('member_equity_payment_version', 'amount',
 
               existing_type=sa.NUMERIC(precision=7, scale=2),
 
               type_=sa.Numeric(precision=10, scale=2),
 
               existing_nullable=True)
 

	
 

	
 
def downgrade():
 

	
 
    # member_equity_payment
 
    op.alter_column('member_equity_payment_version', 'amount',
 
               existing_type=sa.Numeric(precision=10, scale=2),
 
               type_=sa.NUMERIC(precision=7, scale=2),
 
               existing_nullable=True)
 
    op.alter_column('member_equity_payment', 'amount',
 
               existing_type=sa.Numeric(precision=10, scale=2),
 
               type_=sa.NUMERIC(precision=7, scale=2),
 
               existing_nullable=False)
rattail/db/model/members.py
Show inline comments
 
@@ -302,7 +302,7 @@ class MemberEquityPayment(Base):
 
            List of equity payments associated with this member account.
 
            """))
 

	
 
    amount = sa.Column(sa.Numeric(precision=7, scale=2), nullable=False, doc="""
 
    amount = sa.Column(sa.Numeric(precision=10, scale=2), nullable=False, doc="""
 
    Amount of the payment.
 
    """)
 

	
0 comments (0 inline, 0 general)