Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

should south migration files be added to source control?

I'm wondering whats the "best" way to use South with multiple developers.

Should the migration files be tracked? The problems rise when two developers create different changes to models.py from a same origin.

If the migration files are tracked:

  1. It is difficult to notice a merge is needed since they are formed with different file names.
  2. and it is difficult to merge anyway.
  3. difficult to apply (need to migrate backwards one migration, merge, migrate forward again)

If they are not tracked:

  1. tweaking migrations can't be shared.
  2. a developer needs to create a migration (and apply it) whenever he pulls a change to models file (instead of just applying it).

Are there more advantages/disadvantages I missed? whats the "best" way? I'm currently using tracked migrations but thinking of changing to untracked, seems its far simpler.

thanks.

like image 225
Iftah Avatar asked May 30 '11 06:05

Iftah


1 Answers

They should definitely be added to source control. You will need to manually (verbally?) co-ordinate changes your models to avoid clashes. If you don't include the migrations in your source control, then other developers won't be able to migrate their database (which defeats the point of actually having migrations).

like image 90
bradley.ayers Avatar answered Oct 17 '22 22:10

bradley.ayers