alpha.MyOtherModel
is using a default numeric key. Sorry, I should have included that in the ticket and so I've modified it to include the MyOtherModel
class.
The problem is that migrations is doing an alter
for a field that changed not just from a CharField
to a ForeignKeyField
but rather to a foreign key of a different type. SQLite and MySQL somehow didn't have a problem with this, but PostgreSQL exploded.
Perhaps a solution would be a warning stage not unlike the prompt you get when trying to add a field with no default=
value? Something like:
It looks like you've changed a CharField to a ForeignKey of a different type. This will generate an AddField and RemoveField. Is that cool with you?