#1843 closed defect (fixed)
syncdb should create intermediary tables
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
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: | no | UI/UX: | no |
Description
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.
Note:
See TracTickets
for help on using tickets.
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).