Code

Opened 5 years ago

Closed 5 years ago

#11114 closed (duplicate)

sql sequence reset ignores through meta-data for ManyToMany relations

Reported by: phaesler Owned by: nobody
Component: Core (Management commands) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The sql sequence reset code in django.core.management ignores any "through" table meta-data on ManyToMany relations. In particular, it assumes that the primary key column of the many-to-many join table is called "id", even if a "through" Model is given that declares a primary key column with a different name.

This affects at least the postgresql and oracle backends:

db/backends/oracle/base.py:186

and

db/backends/postgresql/operations.py:130

Both explicitly set the primary key column name to "id".

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by jcd

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #11107. Thanks for pointing out the Oracle issue. I'm adding it to the patch on the other ticket.

Cheers,
Cliff

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.