Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7565 closed (fixed)

Fixture problem with child models

Reported by: casey@… Owned by: mtredinnick
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: UI/UX:


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 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to mtredinnick
  • Patch needs improvement unset

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 Changed 8 years ago by ikelly

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

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