Migration hell again. Here's what happened:
Converted a CharField into a ForeignKey field. I get errors from postgres saying the char can't be cast to an integer. Problem is, I didn't get this error on my development machine, only on the box I'm trying to deploy to. When I try to migrate backwards on my development machine so that I can tweak the migration, I get a similar error on the backward migration on a different column. One that was a ForeignKey field and is now a Char Field.
The fix for the backwards migration was to add two manual sql migrations. The first one to allow nulling fields, and the second to null the fields. Then there's no issue moving from a char field to a foreign key. This does mess with the null constraint. Hopefully that won't bite me.
Monday, April 25, 2016
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment