]> git.mxchange.org Git - friendica.git/commitdiff
table cleanup
authorfriendica <info@friendica.com>
Thu, 12 Apr 2012 12:15:45 +0000 (05:15 -0700)
committerfriendica <info@friendica.com>
Thu, 12 Apr 2012 12:15:45 +0000 (05:15 -0700)
include/Contact.php
include/items.php

index 532ea2f957cf15e1c4bc1c605e6c547ea0a663ad..ee434cb6db4f3f201d390ee8678bad331e42a1a4 100644 (file)
@@ -23,16 +23,24 @@ function user_remove($uid) {
        );
 
        q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `gcign` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `group` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `group_member` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `intro` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `event` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `item` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `item_id` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `mail` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `mailacct` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `manage` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `notify` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `photo` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `attach` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `search` WHERE `uid` = %d", intval($uid));
+       q("DELETE FROM `spam` WHERE `uid` = %d", intval($uid));
        q("DELETE FROM `user` WHERE `uid` = %d", intval($uid));
        if($uid == local_user()) {
                unset($_SESSION['authenticated']);
index 3a931b68c085e6eb44034856119f3f0b8da772e4..05c0d501698f3b3c535b38ca70890c8c6412d3c9 100644 (file)
@@ -2974,12 +2974,23 @@ function item_expire($uid,$days) {
                if($expire_items==0 && $item['type']!='note')
                        continue;
 
+
                $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
                        intval($item['id'])
                );
 
+               $r = q("DELETE FROM item_id where iid in (select id from item where parent = %d) and uid = %d",
+                       intval($item['id']),
+                       intval($uid)
+               );
+
+               $r = q("DELETE FROM sign where iid in (select id from item where parent = %d) and uid = %d",
+                       intval($item['id']),
+                       intval($uid)
+               );
+
                // kill the kids
 
                $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ",