Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many-many relationships not functional #228

Open
CameronNemo opened this issue Oct 1, 2019 · 6 comments
Open

many-many relationships not functional #228

CameronNemo opened this issue Oct 1, 2019 · 6 comments

Comments

@CameronNemo
Copy link

CameronNemo commented Oct 1, 2019

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}]
@cgearing
Copy link

cgearing commented 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
Copy link
Author

Was so long ago. I do not remember.

@KeironO
Copy link

KeironO commented Jan 6, 2021

I've been experiencing similar issues, I was wondering if anyone has a solution for this?

@killthekitten
Copy link
Contributor

Hey @KeironO, I could try to help you out! Could you provide some boilerplate code to reproduce the error?

@KeironO
Copy link

KeironO commented Jan 8, 2021

@killthekitten I have meetings this morning, but will get something up this afternoon.

@Korrar
Copy link

Korrar commented Feb 11, 2025

Anyone found some workaround or advice how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants