diff --git a/corepos/db/office_trans/model.py b/corepos/db/office_trans/model.py index d484b4b..b203240 100644 --- a/corepos/db/office_trans/model.py +++ b/corepos/db/office_trans/model.py @@ -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}"