X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Ffixup_conversations.php;h=80890fe98d8ec82fc07b95aa945dc18636b6d0db;hb=3224f7fec9906b00684851759fcb476517d14e48;hp=2cfa422e659f859806c7cdea78fba016963062ad;hpb=65f784120b45dc187e28313fa2c2dca2c976c150;p=quix0rs-gnu-social.git diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index 2cfa422e65..80890fe98d 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -1,8 +1,8 @@ #!/usr/bin/env php whereAdd('conversation is null'); -$notice->orderBy('id'); - -$cnt = $notice->find(); - -print "Found $cnt notices.\n"; +$notice->query('select id, reply_to from notice where conversation is null'); while ($notice->fetch()) { - print "$notice->id =>"; - + $cid = null; + $orig = clone($notice); - + if (empty($notice->reply_to)) { $notice->conversation = $notice->id; } else { @@ -52,6 +47,9 @@ while ($notice->fetch()) { } else { $notice->conversation = $reply->conversation; } + + unset($reply); + $reply = null; } print "$notice->conversation"; @@ -63,5 +61,8 @@ while ($notice->fetch()) { continue; } + $orig = null; + unset($orig); + print ".\n"; }