I need to delete a user. I searched around and I found this old e-mail to this list. It is about 2 years old and I'm wondering if it is still true. I understand that there may be undesired effects if the user being deleted has existing edits. I found some reassignEdits.php file in the maintenance directory. Is it safe to manually delete a user from the database after I run this script first to re-assign their edits? What all do I have to delete, just one record from the user table? Will deleting this record cascade any deletes?
Thanks, ~Eric
http://mail.wikipedia.org/pipermail/mediawiki-l/2004-October/001662.html
On Oct 4, 2004, at 12:29 PM, Chuck Bishop wrote:
Is there a way to delete a user login account?
Not through the wiki interface, but you could delete the record from the database. Then anyone could create a new account with the same name, which may or may not be what you want and could cause unwanted and confusing effects regarding attributions if there are existing edits by the deleted user.
-- brion vibber (brion @ pobox.com)
On Wednesday, 2nd August 2006 at 10:27:00 (GMT -0400), Frederich, Eric P2173 wrote:
Is it safe to manually delete a user from the database [...]?
That's another one I explored, and found the following statement (from 28 March 2006) by Rob Church:
Deleting users is a double-edged sword. It's simple enough to do in SQL but could cause problems when breaking the relational structure of the database. A safe option would be to update the archive, revision and recentchanges tables, altering the numeric user_id foreign key to be 0 for each of the rows corresponding to users you want to delete, then deleting them.
This way, MediaWiki treats the user as nonexistent and won't throw up bizarre errors in obscure places later on.
http://www.archivum.info/mediawiki-l@wikimedia.org/2006-03/msg00479.html
It appears as though running the reassignedits script in the maintenance directory actually does update the archive, revision, and recentchanges tables.
Would someone please explain why there is an option to not update the recent changes table?
Does the --norc option even do anything? In the reassignEdits function I see $rc = false. function reassignEdits( &$from, &$to, $rc = false, $report = false )
I don't know PHP but does this initialize the rc parameter to false?
Thanks, ~Eric
-----Original Message-----
Deleting users is a double-edged sword. It's simple enough to do in SQL but could cause problems when breaking the relational structure of the database. A safe option would be to update the archive,
revision
and recentchanges tables, altering the numeric user_id foreign key to be 0 for each of the rows corresponding to users you want to delete, then deleting them.
This way, MediaWiki treats the user as nonexistent and won't throw up bizarre errors in obscure places later on.
http://www.archivum.info/mediawiki-l@wikimedia.org/2006-03/msg00479.html
On 02/08/06, Frederich, Eric P2173 eric.frederich@siemens.com wrote:
It appears as though running the reassignedits script in the maintenance directory actually does update the archive, revision, and recentchanges tables.
Would someone please explain why there is an option to not update the recent changes table?
(sigh) Well, to stop speculation on the issue, I'll return from the dead long enough to explain that updating recentchanges on a large site is a hellish operation which causes deadlocks and all sorts of other pleasant things like that when it's done. For instance, if it was used on the English Wikipedia, then it would raise the database server load to an unreasonable level.
Does the --norc option even do anything? In the reassignEdits function I see $rc = false.
Assuming I didn't remove it and forget to update the function, and assuming no idiot has gone and messed up the code since, then the answer is going to be "yes".
function reassignEdits( &$from, &$to, $rc = false, $report = false )
I don't know PHP but does this initialize the rc parameter to false?
This is an excellent chance to read http://www.php.net and discover all about default parameter values, isn't it?
Rob Church
mediawiki-l@lists.wikimedia.org