Tweak primary key for StockPurchase model

per having a better understanding now, i think..
This commit is contained in:
Lance Edgar 2023-09-07 17:45:14 -05:00
parent 5921a18f12
commit 0e30303947

View file

@ -32,7 +32,8 @@ Base = orm.declarative_base()
# TODO: not sure what primary key should be for this? am trying a
# composite one so far, we'll see...
# composite one so far, we'll see...cf. also andy's comments in
# https://github.com/CORE-POS/IS4C/pull/1189#issuecomment-1597481138
class StockPurchase(Base):
"""
Represents a member equity payment.
@ -43,13 +44,13 @@ class StockPurchase(Base):
amount = sa.Column('stockPurchase', sa.Numeric(precision=10, scale=2), nullable=True)
datetime = sa.Column('tdate', sa.DateTime(), nullable=True, primary_key=True)
datetime = sa.Column('tdate', sa.DateTime(), nullable=True, primary_key=True, autoincrement=False)
transaction_number = sa.Column('trans_num', sa.String(length=50), nullable=True, primary_key=True)
transaction_id = sa.Column('trans_id', sa.Integer(), nullable=True)
department_number = sa.Column('dept', sa.Integer(), nullable=True)
department_number = sa.Column('dept', sa.Integer(), nullable=True, primary_key=True, autoincrement=False)
def __str__(self):
return f"#{self.card_number} for ${self.amount}"