Hey Nicola,

Django's migration system doesn't natively support "drop this foreign key 
constraint from the database", because you shouldn't be able to run into 
such a situation with the migration system at all (if you do, that's a bug 
from my point of view). I suggest you go with a "RunSQL" operation where 
you drop the 
constraint: 
https://docs.djangoproject.com/en/1.7/ref/migration-operations/#django.db.migrations.operations.RunSQL

/Markus

On Friday, November 14, 2014 4:23:52 PM UTC+1, drakkan wrote:
>
> Hi,
>
> I'm migrating my app to 1.7 and to builtin django migrations from south, I 
> need something like this:
>
>
> http://south.readthedocs.org/en/latest/databaseapi.html#db-delete-foreign-key
>
> how to remove a foreign key using django builtin migration api?
>
> Please note that my purpose is to remove the foreign key and then add it 
> back with "ON DELETE CASCADE" constraint, actually I use the south api to 
> remove the foreign key and then database specific sql to add it with the 
> constraint I need. I would like to avoid to use sql specific code to find 
> the foreign key too,
>
> thanks
> Nicola
>

-- 
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/2351200e-4c07-4a1a-9ccf-2d4652a03565%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to