﻿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
12339	ContentType update could cascade deletes to generic foreign keys, causing data loss	Kenneth Arnold	nobody	"Imagine that you change the name of a model. contrib/contenttypes/management.py has logic to remove unused content types. It does this by calling {{{ct.delete()}}}. The delete will cascade to any other models that reference that {{{ContentType}}}. If you have generic foreign key, this could cause any items that referred to the old table to get deleted. At least you lose the admin log, which could be valuable audit data; you could also lose any data (like votes) that applied to the old object that you haven't yet ported over -- and unless you're running syncdb doubly verbose, you'd never notice.

I hope this bug is invalid and the delete doesn't actually cascade, or something makes sure things are never deleted first. But I noticed this because of a Postgres {{{IntegrityError}}} upon that hook trying to delete a {{{ContentType}}} that was still referenced by the admin log. I don't recall the exact error text, but what I Googled was ""django_content_type still referenced"".
"		closed	Contrib apps	1.1		fixed	contenttype, delete, cascade		Accepted	1	0	0	0	0	0
