Modify

Ticket #452 (closed defect: wontfix)

Opened 4 years ago

Last modified 4 years ago

0.7 does not work with 0.6 migrations where custome fields are referenced

Reported by: artem.skvira@… Owned by: andrew
Priority: major Milestone: 0.7.1
Component: migrations Version: 0.7
Keywords: Cc:

Description

When trying to rollback the migration, south fails on the ones created before 0.7 and containing references to the custom fields.

In 0.6 those were created like the following:

'mobile': ('PhoneNumberField?', [], {}),

However 0.7 fails on them with this message:

Rolling back DB...
Traceback (most recent call last):
...

db.alter_column('app_business', 'mobile', self.gf('PhoneNumberField?')())

File "/home/user/Dropbox/app/external/south/v2.py", line 12, in gf

return ask_for_it_by_name(field_name)

File "/home/user/Dropbox/app/external/south/utils.py", line 27, in ask_for_it_by_name

ask_for_it_by_name.cache[name] = _ask_for_it_by_name(name)

File "/home/user/Dropbox/app/external/south/utils.py", line 16, in _ask_for_it_by_name

module = import(modulename, {}, {}, bits[-1])

ImportError?: No module named PhoneNumberField?

Attachments

Change History

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone set to 0.7.1

This is a known incompatibility, and is mentioned (perhaps too subtly) in the release notes: http://south.aeracode.org/docs/releasenotes/0.7.html#backwards-incompatible-changes

The fix is to either make a new empty migration with schemamigration --empty appname 07_fix (before you make any changes), to get a new baseline that the automigrator can use, or to replace the "PhoneNumberField?" string in the old migration's models dict with the full path, like "foo.bar.fields.PhoneNumberField?".

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.