Hi there, since Django 1.7 release is coming soon, I decided to take some time and learn how the workflow will be when working with these Migrations, and decided to share my experience with you.
So, first of all we have the
that replaces the old
This is the command that will execute the migrations, and create the initial Django tables (for auth, session and etc). But you should see now that the superuser for the DB is not created with this.
So you have to create it using the command:
Another command that appeared is the
and he is the one that will create the migration files representing the changes in your models.py.
So the basic idea is:
- Modify models.py
- Make the migration with: makemigrations
- Execute the migration with: migrate
A Workflow Example
I created a git repository(django-17-migrations-example) that has a simple workflow of what you’ll probably face when doing your projects.
In it you’ll be see a simple Polls app using migration, all you have to do is navigate through the commits and execute the migrations.
I use Scheme Migrations and Data Migrations, and also implement a simple rollback for a custom made migration.
You can check the complete workflow and let it guide you, in the Readme of the project.
That’s it guys.
Good migrations for you.