I'm trying to convert one of my model fields (units) from FloatField to an IntegerField.
My strategy is this:
Migrations for steps 1 - 3 run fine but at Step 4 I get an error when I run the tests:
django.db.utils.OperationalError: no such column: myapp_mymodel._units
For this step I made an empty migration then added to the operations;
migrations.RenameField('MyModel', '_units', 'units')
Where am I going wrong?
Use migrations.AlterField
it will do all 4 steps in one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With