“cannot be cast to type integer” error

后端 未结 2 605
太阳男子
太阳男子 2020-12-31 15:52

This is my first question so I will appreciate patience.

I changed a few attributes to IntegerField from CharField. Listed below is the code:

rating         


        
2条回答
  •  一整个雨季
    2020-12-31 16:38

    You need to add "USING (col_name::integer)" to eliminate this error. But in that case you have to use direct query.

    migrateEngine.execute('ALTER TABLE test ALTER COLUMN testScore TYPE INTEGER USING testScore::integer')

提交回复
热议问题