Page MenuHomePhabricator

[User request] Delete user account
Closed, ResolvedPublic

Description

Per email request from a user, please delete user account with user_id = 1354 (email t**e@s**a.com)

Event Timeline

Here's how I propose we go about it:

kubectl exec -it deployment/api-app-backend -- php artisan tinker
> User::find(1354)->delete();
> WikiManager::where("user_id", 1354)->get()->pluck("wiki_id")->each(function ($wiki_id) { Wiki::find($wiki_id)->delete(); });

Here's how I propose we go about it:

kubectl exec -it deployment/api-app-backend -- php artisan tinker
> User::find(1354)->delete();
> WikiManager::where("user_id", 1354)->get()->pluck("wiki_id")->each(function ($wiki_id) { Wiki::find($wiki_id)->delete(); });

Can confirm this works (tested locally)

Were we also asked to delete the Wikis/is this something we ought to check?
Can we not soft delete the user (and optionally remove any possibly personal information (e.g. the email if that's what they requested) while leaving the Wikis untouched (i.e. line 1 only of the REPL)?

Otherwise by eye this does look like it does soft delete the Wiki's owned by that user.

User email wiped and password reset using tinker:

$user = User::find(1354)
$user->password = random_bytes(20)
$user->email = "<redacted>"