views:

117

answers:

2

I kept thinking a lot about the meaning of migrating a Django app the last few days and heard about migrating Django apps with django-south. Maybe it's just the lack of sufficient English skills (as English is not my native language) or this is one of the things you confront in a programmer's life which are so simple, that it takes a genius to understand them (at first).

I've read the translation of 'migrate' in my native language, read the definition of migration on Wikipedia and read "the idea" of django-south, citing:

With South, you install it and then give one or more of your apps some migrations (either writing them by hand, or autogenerating them from your model definitions). When you syncdb, you'll only sync apps that don't have migrations (things like django.contrib.auth, for example, which have a fixed schema), and then when you run ./manage.py migrate, South kicks in and does the migrations. Intelligently.

This is confusing and I still don't understand the whole thing behind "migration of django applications" or "migration in general". I'd understand if I'd know how to interpret the word migration

You get the point, I hope.

Have patience with me, but I'd really like to know. So maybe one of you could explain me, please.

Thanks for your time in advance.

+1  A: 

Migrate typically refers to moving an application from one location to another. This translation can happen either via a physical movement. (Such as moving from one server to another), or as a more logical movement. (Such as from C# to F#)

Given that only one technology is mentioned. It is likely primarily a physical movement application with a slight logical movement of the database side.

To summarize what the application does. It likely simply exports all of your configuration and data to a file structure, which can then be reintegrated into your database on the new server.

Guvante
+6  A: 

When it comes to talking about South and Django, a migration refers to changing the database schema.

The syncdb command that is built into Django cannot automatically change schema for you without deleting everything first, which is why things like South and dmigrations have come about.

So, essentially a migration is a way to alter your database schema while keeping your data intact.

From the dmigrations page:

With dmigrations, every change to your database (including the creation of your initial tables) is bundled up in a migration. Migrations are Python files that live in a migrations directory. They can be applied and un-applied (reverted) in sequence.

TM
"So, essentially a migration is a way to alter your database schema while keeping your data intact." This absolutely makes sense now. Thanks, TM.
Kenny M.