Django 1.8 - what's the difference between migrate and makemigrations?

后端 未结 8 764
说谎
说谎 2021-01-30 16:23

According to the documentation here: https://docs.djangoproject.com/en/1.8/topics/migrations/ it says:

migrate, which is responsible for applying migrations, as          


        
8条回答
  •  遇见更好的自我
    2021-01-30 17:09

    You should run the command -migrate- after adding a new app under the INSTALLED APPS section in the settings.py file in order to synchronize the database state with your current set of models. Assuming you've already modified the models.py file.

    When you run -makemigrations- it packages up changes to your model into individual migration files.

    Normally you would first run makemigrations and then migrate.

    See documentation on Django Models

提交回复
热议问题