diff --git a/corepos/db/office_op/model.py b/corepos/db/office_op/model.py index 5e9a34a..16bbc57 100644 --- a/corepos/db/office_op/model.py +++ b/corepos/db/office_op/model.py @@ -80,7 +80,9 @@ class TableSyncRule(Base): """ __tablename__ = 'TableSyncRules' - id = sa.Column('tableSyncRuleID', sa.Integer(), nullable=False, primary_key=True, autoincrement=True) + # nb. this should be autoincrement, but we can't do that + # automatically via sqlalchemy when PK is composite + id = sa.Column('tableSyncRuleID', sa.Integer(), nullable=False, primary_key=True) table_name = sa.Column('tableName', sa.String(length=255), nullable=False, primary_key=True) @@ -1617,8 +1619,11 @@ class CustomReceiptLine(Base): """ __tablename__ = 'customReceipt' - sequence = sa.Column('seq', sa.Integer(), primary_key=True, autoincrement=True, nullable=False) - type = sa.Column(sa.String(length=20), primary_key=True, autoincrement=False, nullable=False) + # nb. this should be autoincrement, but we can't do that + # automatically via sqlalchemy when PK is composite + sequence = sa.Column('seq', sa.Integer(), primary_key=True, nullable=False) + + type = sa.Column(sa.String(length=20), primary_key=True, nullable=False) text = sa.Column(sa.String(length=80), nullable=True) def __str__(self):