[Django-india] migration files in SCM

Gaurav Dadhania gaurav.dadhania at gmail.com
Mon Oct 20 15:21:09 CEST 2014


Yep, you commit the migration files. Think of it as the same workflow as
when you were using South before migrations were introduced to Django core.
There are several reasons to do this:

* When you check out a project and run `manage.py migrate`, your database
schema should be ready to run the app — ease of getting started
* Committing the migrations means, every developer will have a consistent
migration history and it will lead to less conflicts in history when
everyone is working on their feature branches as you're using a distributed
version control system
* You're not only going to have schema migrations that can be generated
with a simple `manage.py makemigrations <app_name>`, you'll have custom
data migrations as well as the project matures — these cannot be generated
automatically in production.

Cheers,
G

On Mon, Oct 20, 2014 at 6:27 PM, Arun Kumar Dharuman <arundhaj at gmail.com>
wrote:

> Hi,
>
> While adding django (v1.7) project to a SCM (GIT), should we even add
> migration files?
>
> or should we have to run the *makemigrations* command in production
> servers?
>     $ python manage.py makemigrations <appname>
>     $ python manage.py migrate
>
>
> Regards
> ArunDhaJ
>
> _______________________________________________
> Django-india mailing list
> Django-india at python.org
> https://mail.python.org/mailman/listinfo/django-india
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/django-india/attachments/20141020/6995a5b5/attachment.html>


More information about the Django-india mailing list