Django: When to run makemigrations?

后端 未结 2 1015
孤街浪徒
孤街浪徒 2021-02-15 11:06

In addition to adding/deleting/modifying field to model, Django also detects changes when I add or modify methods to the model.

So my question is should I run make

2条回答
  •  隐瞒了意图╮
    2021-02-15 11:49

    When you add/change model methods, then you don't need to run ./manage makemigrations and ./manage.py migrate.

    But whenever you edit your model fields (adding a new one, changing an existing one or altering any of the arguments it takes) then you should always run migrations.

提交回复
热议问题