Database migrations

Django uses a concept of database migrations to record and execute changes to the database. These changes include table creation and schema alterations. Now that we have generated the data models, we need to migrate the database, which involves inspecting models.py for changes, calculating the SQL syntax to generate the database alterations, and then running the required migrations to make the database table columns match their models.py code definitions. These migrations can also be reverted.

Get Mastering Geospatial Analysis with Python 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.