Resolve SQL Error when deleting an account

The account deletion code tries to remove user from PackageNotifications
using the wrong column UsersID to identify the user by id. In the
PackagePackageNotifications table the foreign key is called UserID. In
the future ideally this would be unified into UserID for all tables.

Closes: #12
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Jelle van der Waa 2021-03-29 22:54:10 +02:00 committed by Lukas Fleischer
parent 21c457817f
commit d668ef0bcd

View file

@ -940,7 +940,7 @@ function user_delete($id) {
$fields_delete = array( $fields_delete = array(
array("Sessions", "UsersID"), array("Sessions", "UsersID"),
array("PackageVotes", "UsersID"), array("PackageVotes", "UsersID"),
array("PackageNotifications", "UsersID") array("PackageNotifications", "UserID")
); );
$fields_set_null = array( $fields_set_null = array(