November 2015
Beginner to intermediate
840 pages
26h 30m
English
Before we actually create a migration for adding a SlugField to NewsLink, I want to make life more difficult to better replicate real-world conditions. To that end, I want the database to already have NewsLink data, which will force us to build our schema migration in the next section with this in mind.
As with Tag, Startup, and Post, we first create the data migration by invoking makemigrations, as shown in Example 10.20.
Example 10.20: Shell Code
$ ./manage.py makemigrations --empty --name=newslink_data organizer
This code creates the 0004_newslink_data.py file in organizer/migrations/.
The NewsLink data migration is very straightforward: there’s no need ...
Read now
Unlock full access