You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like an autoincrement directive is missing for the id column.
[...]/venv/lib/python3.7/site-packages/sqlalchemy/sql/crud.py:799: SAWarning: Column 'site_contact_version.id' is marked as a member of the primary key for table 'site_contact_version', but has no Python-side or server-side default generator indicated, nor does it indicate 'autoincrement=True' or 'nullable=True', and no explicit value is passed. Primary key columns typically may not store NULL. Note that as of SQLAlchemy 1.1, 'autoincrement=True' must be indicated explicitly for composite (e.g. multicolumn) primary keys if AUTO_INCREMENT/SERIAL/IDENTITY behavior is expected for one of the columns in the primary key. CREATE TABLE statements are impacted by this change as well on most backends.
util.warn(msg)
2019-10-01 12:37:52,592:WARNING:flask_appbuilder.models.sqla.interface:Add record integrity error: (psycopg2.errors.NotNullViolation) null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, 1, 1, 2, null, 0).
[SQL: INSERT INTO site_contact_version (site_id, contact_id, transaction_id, operation_type) VALUES (%(site_id)s, %(contact_id)s, %(transaction_id)s, %(operation_type)s)]
[parameters: {'site_id': 1, 'contact_id': 1, 'transaction_id': 2, 'operation_type': 0}]
Reacted by David Chen, Gordon Fierce and Rob Toyota
Activity
cgearing commentedon Dec 7, 2020
I'm also getting this issue - I believe the problem comes when your join tables have an auto-incrementing ID as well.
Is that the case for you?
CameronNemo commentedon Dec 18, 2020
Was so long ago. I do not remember.
KeironO commentedon Jan 6, 2021
I've been experiencing similar issues, I was wondering if anyone has a solution for this?
killthekitten commentedon Jan 7, 2021
Hey @KeironO, I could try to help you out! Could you provide some boilerplate code to reproduce the error?
KeironO commentedon Jan 8, 2021
@killthekitten I have meetings this morning, but will get something up this afternoon.
Korrar commentedon Feb 11, 2025
Anyone found some workaround or advice how to fix it?