﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26989	Provide a way of specifying ON DELETE and On UPDATE properties in model DDL	jgraham	nobody	"I have read [1] and I understand that in general Django has good reasons for emulating ON DELETE behaviour such as ON DELETE CASCADE. However we have a case where the database native support is sufficient to meet our needs, and will provide a performance win on a problematically-slow bulk delete operation. It is possible for us to configure this e.g. by using a migration with a RawSQL operation, but if we take this approach we no longer have the ability to recreate the full database state from the django model. Therefore it would be helpful if there was a way to specify these properties in the model, even if django does not rely on them during normal operations.

This would provide feature parity with SQLAlchemy in this area, which also uses emulated cascading behaviour by default, but allows specifying the schema-level constructs to be specified in the DDL [2].

[1] https://groups.google.com/forum/#%21topic/django-developers/FGDanrS9vlw
[2] http://docs.sqlalchemy.org/en/rel_1_0/orm/cascades.html#delete"	New feature	closed	Database layer (models, ORM)	1.10	Normal	duplicate		emorley@…	Unreviewed	0	0	0	0	0	0
