postgresql - Django + South - migration can't cast the column type - wants me to use "USING" -
i'm getting error when try run ./manage.py migrate my_app:
django.db.utils.programmingerror: column "associated" cannot cast automatically type integer
hint: specify using expression perform conversion.
that sounds great advice, don't know south wants me do. supposed manually edit auto-generated python migration file? if so, how -- don't see standard sql in file. instead, see this:
# changing field 'mytable.associated' db.alter_column(u'data_mytable', 'associated', self.gf('django.db.models.fields.integerfield')() ) also, why didn't south pick on , add using clause automatically?
this dirty hack:
- manually added migraton removing offendig field i.e
migrations.removefield( model_name='name_of_the_model', name='offending_field', ) 2. changed operation of complaining migration alterfield addfield i.e
migrations.addfield( model_name='name_of_model', name='name_of_field', field=models.foreignkey(blank=true, null=true, to='foreignkeymodel'), preserve_default=false, ), ```
Comments
Post a Comment