]> git.mxchange.org Git - friendica.git/commitdiff
Ensure that the thread-user-data does exist
authorMichael <heluecht@pirati.ca>
Mon, 15 Feb 2021 15:12:49 +0000 (15:12 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 15 Feb 2021 15:12:49 +0000 (15:12 +0000)
update.php

index a59f0ca1352311333df863140fa207aa56b93ad8..6f796cd0fa692af7da80a0a8f36ac06068221fb3 100644 (file)
@@ -799,6 +799,14 @@ function update_1400()
                return Update::FAILED;
        }
 
+       if (!DBA::e("INSERT IGNORE INTO `post-thread-user` (`uri-id`, `owner-id`, `author-id`, `causer-id`, `network`,
+               `created`, `received`, `changed`, `commented`, `uid`,  `wall`, `contact-id`, `unseen`, `hidden`, `origin`, `psid`, `post-user-id`)
+               SELECT `uri-id`, `owner-id`, `author-id`, `causer-id`, `network`, `created`, `received`, `received`, `received`,
+                       `uid`, `wall`, `contact-id`, `unseen`, `hidden`, `origin`, `psid`, `id`
+               FROM `post-user` WHERE `gravity` = 0 AND NOT EXISTS(SELECT `uri-id` FROM `post-thread-user` WHERE `post-user-id` = `post-user`.id)")) {
+               return Update::FAILED;
+       }
+
        if (!DBA::e("UPDATE `post-thread-user` INNER JOIN `post-thread` ON `post-thread-user`.`uri-id` = `post-thread`.`uri-id`
                SET `post-thread-user`.`owner-id` = `post-thread`.`owner-id`, `post-thread-user`.`author-id` = `post-thread`.`author-id`,
                `post-thread-user`.`causer-id` = `post-thread`.`causer-id`, `post-thread-user`.`network` = `post-thread`.`network`,