Modify ↓
Ticket #67 (closed defect: fixed)
--add-field for m2m fields generates invalid code
| Reported by: | eallik@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | commands | Version: | 0.6-pre |
| Keywords: | Cc: | eallik@… |
Description
When doing startmigration appname --add-field MyModel?.field, the migration that gets generated has the following code in its backwards method:
db.delete_column('myapp_mymodel', 'field')
which is invalid because 'field' is not an actual field in the database. The command should either generate working code, or the semantics of db.delete_column could be changed to accommodate this behavior.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Fixed in [122]. (The forwards side was also useless, since you need to manually create tables).
Also, note one of the answers in the FAQ; if you're using through=, then use --model, not --add-field.