I'm writing a plugin that creates a custom table holding data which is linked to a user account with a user_id
field. Now if that users account would be deleted for any reason I would like to set that user_id
field in my custom table to 0
to keep the stored data in an anonymized fashion.
Since the first user ID
is 1
and counted upwards from there I would assume this is save. Is there any reason why this might have unwanted side effects?
Also, if I would add key constraints to my custom table this would obviousle be a problem when 0
is not existent in wp_users
. Would it be hazardous to add a fake user record with id 0
to wp_users
?