Postgresql operator class “varchar_pattern_ops” does not accept data type integer

后端 未结 2 1029
一整个雨季
一整个雨季 2021-01-05 06:56

I\'m trying migrate my data id postgresql from string to integers in django to use them in sphinx search. So first of all I\'m making data migration, converting my data to i

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 07:18

    To be deal with this problem you have to use 2 steps of migrations.

    First : Add db_index=False on your first migration then generate and run the migration.

    Second : Update db_index=True to your related column in model (according to the first step) then generate the migration and run again.

    This based on my experience on some project, and it works.

    Hope it helps.

提交回复
热议问题