Ensure users can be deleted when foreign keys are present

This change is necessary to prevent this:
    mysql> delete from Users where ID = 112;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`aur`.`Packages`, CONSTRAINT `Packages_ibfk_2` FOREIGN KEY (`SubmitterUID`) REFERENCES `Users` (`ID`) ON DELETE NO ACTION)

As a bonus, due to foreign keys, orphaning of packages will be
automatic.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Dan McGee 2011-03-01 10:21:06 -06:00 committed by Lukas Fleischer
parent abd41bbb51
commit f9eba12312
2 changed files with 3 additions and 3 deletions

View file

@ -801,7 +801,6 @@ function user_suspended( $id )
/*
* This should be expanded to return something
* TODO: Handle orphaning of user's packages
*/
function user_delete( $id )
{