3.5.1 Understanding Migrations
Models allow us to define the structure, relations, and behavior of the data we use on our website. The behavior we’ve defined will have a direct effect on our use of the data in Python (as we shall see in the next section), but the structure we’ve created is just an abstraction for how the data will be stored in the database. In Django, models and the database schema are reflections of one other. Any modification of one must result in the modification of the other. In a fully deployed team project, this can be quite tricky. If one developer makes a change to his or her local test database, he or she needs a way to share these changes with other developers and the various servers running the website(s) in a repeatable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access