Currently it is not possible to add a User with the email address of a previously deleted User.
As per Users Dokumentation Users are only soft-deleted and it should be possible to create a new User with the same email address, that will take over the history of the previously existing user.
An error is displayed: Duplicate key "[email protected]" for collection "directus_users"
We'll have to think through this as a bigger solution. The question becomes: what should happen to unique values when using soft delete. If you soft delete something, the record persists, and the unique value is still taken.
We could create a special case for users that it will "take over" the record from the previously deleted one, but I'd rather come up with a flow that isn't hardcoded for a single directus collection
@benhaynes @WoLfulus @shealavington any bright ideas?
Well, for Users I would imagine adding a user that _previously_ existed would prompt to "re-enable" them.
For a solution that works everywhere, the only real option is to pull the item from the collection and store it elsewhere. Matching schema with a "trash" table would be super annoying, so I would recommend using Activity/Revisions to store the "final state". We might already be doing this — in which case we could remove the "soft-delete" feature from status and focus on making activity/revisions more robust (including "staged draft" changes on items that are already published).
Thanks for reacting so quickly and BTW I completely forgot to mention: I am a huge fan of directus!
The main problem with this issue is, that there is no way to bring back the soft-deleted users for admins or even via the API. If there would be a way to also show and edit the "deleted" users, then in a way, the problem would solve itself.
This is actually something we're actively working on as we speak within Directus 9. Admins will be able to see all soft-deleted items, and will have dedicated UI buttons for "Delete Forever" and "Restore".
Looking forward to see Number 9 in action then! Thanks for all your work!
Ref https://github.com/directus/app-next/issues/344#issuecomment-610467017 🙂
Any update with this issue? I've met exactly the same issue.
Good Day
Is there any way in version 8 that I can bring the user back?
Can I just delete the user in the database table??? (I should then be able to re-create it)
Please note that you can just connect to your database and then change the following(in my case I used mysql client):
UPDATE directus_users (this is the table within the database)
SET status = 'active'
WHERE id = 1; (ID of the user)
Most helpful comment
Thanks for reacting so quickly and BTW I completely forgot to mention: I am a huge fan of directus!
The main problem with this issue is, that there is no way to bring back the soft-deleted users for admins or even via the API. If there would be a way to also show and edit the "deleted" users, then in a way, the problem would solve itself.