Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7565 closed (fixed)

Fixture problem with child models

Reported by: casey@… Owned by: Malcolm Tredinnick
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There seems to be a problem importing fixtures for child models. Supposing I have a model myapp.MyGroup that inherits from auth.Group, and I have a fixture that includes MyGroup data, I receive the following error:

psycopg2.ProgrammingError: column "id" does not exist at character 54

generated from this SQL:

SELECT setval('"myapp_mygroup_id_seq"', coalesce(max("id"), 1), max("id") IS NOT null) FROM "myapp_mygroup";

As far as I can tell, it appears that it is attempting to updating the sequence for the pk of the child model (for which there is none) using the "" column (which doesn't exist).

Change History (3)

comment:1 Changed 10 years ago by Malcolm Tredinnick

Owner: changed from nobody to Malcolm Tredinnick

comment:2 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [7789]) Fixed #7565 -- Fixed a problem with PostgreSQL sequence resetting in loaddata.

comment:3 Changed 10 years ago by Ian Kelly

(In [7831]) Refs #7565. Fixed Oracle sequence resetting on child models.

Note: See TracTickets for help on using tickets.
Back to Top