3.5.2 Creating Migrations

Migration generation, like most other interactions with Django, occurs thanks to the manage.py script.

Before actually generating a migration, run the check command, shown in Example 3.23. Django will warn you if there are any typos or problems with your models.

Example 3.23: Shell Code

$ ./manage.py check System check identified no issues (0 silenced).

Satisfied with the output of check, we can then run the makemigrations command. In Example 3.24, I run the command twice, specifying each app.

Example 3.24: Shell Code

$ ./manage.py makemigrations organizer Migrations for 'organizer':   0001_initial.py:     - Create model NewsLink     - Create model Startup ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.