Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I keep my South migrations in version control?

I'm not sure if I should keep them around or not. The main reason I'm using south at the moment is to ease development changes to the model, though I suppose it will come in handy when I'm in production. Should I be keeping my local development migrations in my Git repository?

like image 374
Naftuli Kay Avatar asked Aug 03 '11 16:08

Naftuli Kay


People also ask

Should I delete migrations Django?

Deleting migration files means losing your history. This historical info is recorded in the django_migrations table in your database. if you delete migration files, you will get dependency errors. So Don't try to lose your history by deleting your migration files.

Where are Django migrations stored?

Migrations are generated per app, and are stored in some_app/migrations . Even if you do not define migrations for your apps, there will usually be migrations that take place, since you (likely) included some apps defined by Django (and other third parties) in your INSTALLED_APPS , these have migrations as well.

What is the difference between Makemigrations and migrate in Django?

migrate , which is responsible for applying and unapplying migrations. makemigrations , which is responsible for creating new migrations based on the changes you have made to your models.


2 Answers

This isn't a technical answer, but if you:

  • want to roll things back at any stage;
  • need to keep a full record of all changes;
  • are building up data in SQLite locally and using it remotely;

it might be a good idea. Why would you not?

Alternatively, you could maintain a separate branch for the South migrations.

like image 63
Dave Everitt Avatar answered Oct 11 '22 09:10

Dave Everitt


Yes, you should. At some point you won't be able to do schema migration without performing additional data migrations. And those are not auto generated.

like image 20
Krzysztof Szularz Avatar answered Oct 11 '22 08:10

Krzysztof Szularz