Opened 10 years ago

Closed 10 years ago

Last modified 3 months ago

#9804 closed (fixed)

sqlflush fails for ManyToMany with inherited intermediary

Reported by: jdimov Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords: ManyToMany, sqlflush, sequence_list
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There's a bug in the sequence_list method of django.db.backends.BaseDatabaseIntrospection, but I don't know how to fix it. It has to do with Many-to-Many relationships through intermediary models, where the intermediary model itself is inherited from a non-abstract base model. In this case, the sequnece_list contains id sequence counter which do not (and should not) actually exist, because the model uses the base model's id counter.

The result of all this is that the manage.py sqlflush command fails, and I can't run my tests.

Change History (5)

comment:1 Changed 10 years ago by Jacob

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [10552]) Fixed #9804 -- Corrected the introspection of sequence names. This was causing problems when flushing tables that had many-to-many relations through an inherited table. Thanks to jdimov for the report.

comment:3 Changed 10 years ago by Russell Keith-Magee

(In [10553]) [1.0.X] Fixed #9804 -- Corrected the introspection of sequence names. This was causing problems when flushing tables that had many-to-many relations through an inherited table. Thanks to jdimov for the report.

Merge of r10552 from trunk.

comment:4 Changed 7 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

comment:5 Changed 3 months ago by Tim Graham <timograham@…>

In 4d98b9d:

Refs #9804 -- Fixed test for sequence reset of M2M with inherited through model.

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