Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between south migrations and django migrations?

Can anyone please explain me the difference between south migrations and django migrations? What advantage/disadvantage one has over another?

like image 801
Pransh Tiwari Avatar asked Sep 10 '18 13:09

Pransh Tiwari


People also ask

What is the difference between migrations and migrate in Django?

You should think of migrations as a version control system for your database schema. makemigrations is responsible for packaging up your model changes into individual migration files - analogous to commits - and migrate is responsible for applying those to your database.

What is South in Django?

South is a migration tool used with Django. There will be times when you would be adding fields to a model or changing the type of field (eg: Field was an IntegerField and you want to change it to FloatField). In such cases syncdb doesn't help and South comes to your rescue.

What is Django migration?

Migration is a way of applying changes that we have made to a model, into the database schema. Django creates a migration file inside the migration folder for each model to create the table schema, and each table is mapped to the model of which migration is created.

What is the difference between migrations and migrate?

makemigrations auto generates migration files containing changes that need to be applied to the database, but doesn't actually change anyhting in your database. migrate will make the actual modifications to your database, based on the migration files.


1 Answers

South is a third part django app that added support for migrations before a builtin migration solution was introduced in Django 1.7. Unless you're stuck with a long-dead Django version, there's no reason you should use South at all. FWIW, just checking the south project's page should have answered your question:

South has been deprecated.

From Django 1.7 upwards, migrations are built into the core of Django. If you are running a previous version, you can find the repository on BitBucket.

Feature-wide both are quite similar (which is not a big surprise since the new builtin migration system started it's life as the 2.0 branch of South), except the new system works better, specially when you have to merge two branches each having it's own migrations.

like image 65
bruno desthuilliers Avatar answered Sep 24 '22 00:09

bruno desthuilliers