xavier-GitHub76 commented on issue #13345:
URL: https://github.com/apache/superset/issues/13345#issuecomment-2220405735

   Hello,
   I systematically reproduce the problem "impossible to delete a user : 
Associated data exists, please delete them first".
   
   I have identified the cause: This only concerns users who have created 
elements in Superset. Despite the deletion of elements created by a user from 
the graphical user interface, the deletion of the user is impossible because 
the "key_value" table is not cleaned at the time of deletion, this creates an 
integrity constraint preventing the deletion of the user.
   
   The other tables (logs, slices, slice_user) are correctly updated.
   
   The “key_value” table has a relationship only with the “ab_user” table.
   
![image](https://github.com/apache/superset/assets/82046143/4530d270-0101-4039-b436-73ea142ee970)
   
   It is possible to work around the problem by executing a delete query on the 
key_value table :
   delete from public.key_value where created_by_fk = <id_user_to_delete>
   
   Testing the workaround : 
   "Deleted Row" 👍 
   
   The following tables are well updated:
       • ab_user.sql
           ◦ Deletion of the line relating to the user
       • ab_user_role.sql
           ◦ Deletion of the line relating to the user
       • logs.sql
           ◦ Lines mentioning <user id>  now mention user = None (like a user 
deleted without objects created)
   
   Best regards


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to