Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1843 closed defect (fixed)

syncdb should create intermediary tables

Reported by: pb@… Owned by: adrian
Component: Core (Management commands) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In general, we count on syncdb to create any tables that need to be created, and not to touch ones that already exist. Intermediary tables needed by M2M relations fall through the cracks -- presumably because they don't have separate models explicitly declared . Unless I'm missing some risk, these tables should be created by syncdb.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by mtredinnick

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

This looks to have been fixed since being filed. If you add a new model to an application and that new model contains a ManyToManyField, we correctly create the intermediate table. The syncdb command will not create the intermediate table if you add a new field to an existing model, but that is because it does not handle model changes -- only creating new models (we don't include the new field either in that case).

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.