What do the following commands do?

  • python manage.py makemigrations
  • python manage.py migrate

The makemigration command scans the model in your application and generates a new set of migrations based on the model file modifications. This command generates the SQL statement, and when we run it, we obtain a new migration file. After running this command, no tables will be created in the database.

Running migrate command helps us to make these modifications to our database. The migrate command runs the SQL instructions (produced by makemigrations) and applies the database changes. After running this command, tables will be created.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *