Hey Abraham,

to be more specific, when you used South and ran "manage.py
datamigration" [1] you got an empty migration file with a forwards and
backwards method where you had to fill out the blanks and tell South
what to do, e.g. to create a certain object in the database.

With Django's migration system you get the same with running "manage.py
makemigrations --empty". Django will generate an empty migration file
that you can fill with the operations to run.

Django offers "migrations.RunPython" to run arbitrary Python code, and
"migrations.RunSQL" do perform raw SQL queries. (For documentation
please see the links Russell send earlier).

Best

/Markus

[1] http://south.readthedocs.org/en/latest/commands.html#datamigration

On 01/14/2015 01:43 PM, James Bennett wrote:
> On Wed, Jan 14, 2015 at 6:34 AM, Abraham Varricatt <
> abraham.varric...@googlemail.com> wrote:
> 
> To be more specific, the document you link clearly mentions that "Django
>> can’t automatically generate data migrations for you"
>>
>>
>> And this is what puzzles me. If it isn't automated and is something that
>> needs to be done manually, what's so great about it's inclusion in Django
>> 1.7?
>>
> 
> Django cannot read your mind to figure out what specific changes to your
> data you'd like to have happen. So writing the logic of the data migration
> is up to you.
> 
> Django *can* usually deduce the necessary schema changes from examining
> what the models looked like before and after. And that's the difference.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/54B66F6C.1000607%40markusholtermann.eu.
For more options, visit https://groups.google.com/d/optout.

Reply via email to