django.db.utils.IntegrityError: column “venue_city” contains null values

前端 未结 5 1208
半阙折子戏
半阙折子戏 2021-01-04 10:08

I have read a lot of other posts here on stackoverflow and google but I could not find a solution.

It all started when I changed the model from a CharField to a For

5条回答
  •  被撕碎了的回忆
    2021-01-04 10:42

    I solved it by just adding null = True to both the (automatically generated) migration file that was causing the issue and in the Model. Then migrate again and your failed migration will now succeed. As you changed it also in your model, makemigration will detect no changes after that.

提交回复
热议问题