diff options
author | Yorhel <git@yorhel.nl> | 2010-11-06 16:59:33 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-11-06 16:59:33 +0100 |
commit | 97ad1042f728f2a82ad8b8f1c59dcc9d39a08f06 (patch) | |
tree | 6d737400c537d6c852e7e545baaf534c77c0baad /lib/VNDB/DB | |
parent | 5f6845d76c1ed3cbfea73b004940749f64dab972 (diff) |
Bugfix: delete/update all references when deleting a user
Really need a cleaner solution for that. PostgreSQL actually provides a
better solution, need to change to that.
Diffstat (limited to 'lib/VNDB/DB')
-rw-r--r-- | lib/VNDB/DB/Users.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index 41f9f25a..b9d66200 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -124,12 +124,17 @@ sub dbUserAdd { # uid sub dbUserDel { my($s, $id) = @_; + # TODO: delete/update all those referenced rows using PgSQL reference actions $s->dbExec($_, $id) for ( q|DELETE FROM rlists WHERE uid = ?|, q|DELETE FROM wlists WHERE uid = ?|, q|DELETE FROM votes WHERE uid = ?|, + q|DELETE FROM tags_vn WHERE uid = ?|, q|DELETE FROM sessions WHERE uid = ?|, + q|DELETE FROM notifications WHERE uid = ?|, + q|UPDATE notifications SET c_byuser = 0 WHERE c_byuser = ?|, q|UPDATE changes SET requester = 0 WHERE requester = ?|, + q|UPDATE tags SET addedby = 0 WHERE addedby = ?|, q|UPDATE threads_posts SET uid = 0 WHERE uid = ?|, q|DELETE FROM users WHERE id = ?| ); |