November 2015
Beginner to intermediate
840 pages
26h 30m
English
A migration is a file or script that modifies the database. Typically, our goal when using a migration is to reflect in our models any changes we’ve made to the structure of our data. The typical workflow for a schema migration is thus as follows:
1. Modify the model.
2. Generate or create the migration.
3. Apply the migration.
With a data migration, given that we are not modifying the migration, the workflow is simply to create and apply the migration.
In Django, a migration is defined by its dependencies and its operations. The dependencies tell Django what we expect to have already happened in the database, while the operations declaratively list the changes we wish to make. Django supplies 16 operations for us ...
Read now
Unlock full access