constdeleteUserUser=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM user_users WHERE invited_user_id='${user.id}' OR user_id='${user.id}'`);
constdeleteDelegatedUserTables=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM delegated_user_tables WHERE delegated_user_id='${user.id}' OR root_user_id='${user.id}'`);
constdeleteUserDatabases=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM user_databases WHERE user_id='${user.id}'`);
constdeleteUserDatabaseTables=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM user_database_tables WHERE user_id='${user.id}'`);
constdeleteUserMedia=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM user_media WHERE user_id='${user.id}'`);
constdeleteDelegatedUsers=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM delegated_users WHERE user_id='${user.id}' OR delegated_user_id='${user.id}'`);
constdeleteUnsubscribes=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM unsubscribes WHERE user_id='${user.id}'`);
constdeleteNotifications=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM notifications WHERE user_id='${user.id}'`);
constdeleteApiKeys=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM api_keys WHERE user_id='${user.id}'`);
constdeleteInvitations=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DELETE FROM invitations WHERE inviting_user_id='${user.id}' OR invited_user_email='${user.email}'`);
constmariadbUsersArray=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`SELECT * FROM mariadb_users WHERE user_id = ?`,[
user.id
]);
for(leti=0;i<mariadbUsersArray.length;i++){
constmariadbUser=mariadbUsersArray[i];
const{username,host}=mariadbUser;
constdeleteMariadbUsers=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DROP USER IF EXISTS '${username}'@'${host}'`);
}
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
constuserDatabases=await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`SHOW databases LIKE 'datasquirel_user_${user.id}_%'`);
for(leti1=0;i1<userDatabases.length;i1++){
constdbObj=userDatabases[i1];
constdbName=Object.values(dbObj);
await_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_0___default()(`DROP database IF EXISTS ${dbName}`);