Modify

Ticket #67 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

--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

comment:1 Changed 5 years ago by andrew

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

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.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.