Описание тега django-migrations
Django migrations are a way to apply changes to a database previously created, introduced in Django 1.7. This tool is used when a model is modified (adding a field, deleting a model, etc.) and you need to apply these changes to your database.
Migrations are introduced in Django 1.7 to make easier modifications in models:
Migrations are Django’s way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema. They’re designed to be mostly automatic, but you’ll need to know when to make migrations, when to run them, and the common problems you might run into.
There are several commands which you will use to interact with migrations and Django’s handling of database schema:
- migrate, which is responsible for (un)applying migrations
- makemigrations, to create new migrations files based on model modifications
- sqlmigrate, which displays the SQL statements for a migration.
- showmigrations, which lists a project’s migrations and their status.
This tag is not about migrating to Django from another framework. This is supposed to replace django-south, which is a third-party mainly used until Django 1.6 to migrate models modifications.