]> git.mxchange.org Git - friendica.git/blobdiff - update.php
Update messages.po
[friendica.git] / update.php
index 7dd0369a3a13443a0586f4ce6f3715d4309ddb64..819085f7ff2f5c6f1342d4f36c3a9e851997b039 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -818,7 +818,17 @@ function update_1400()
        return Update::SUCCESS;
 }
 
-function update_1403()
+function pre_update_1403()
+{
+       // Necessary before a primary key change
+       if (!DBA::e("DROP TABLE `parsed_url`")) {
+               return Update::FAILED;
+       }
+
+       return Update::SUCCESS;
+}
+
+function update_1404()
 {
        $tasks = DBA::select('workerqueue', ['id', 'command', 'parameter'], ['command' => ['notifier', 'delivery', 'apdelivery', 'done' => false]]);
        while ($task = DBA::fetch($tasks)) {
@@ -873,6 +883,32 @@ function update_1403()
                                continue 2;
                }
                DBA::update('workerqueue', ['parameter' => json_encode($parameters)], ['id' => $task['id']]);
+
+               return Update::SUCCESS;
+       }
+}
+
+function update_1407()
+{
+       if (!DBA::e("UPDATE `post` SET `causer-id` = NULL WHERE `causer-id` = 0")) {
+               return Update::FAILED;
+       }
+       if (!DBA::e("UPDATE `post-user` SET `causer-id` = NULL WHERE `causer-id` = 0")) {
+               return Update::FAILED;
+       }
+       if (!DBA::e("UPDATE `post-thread` SET `causer-id` = NULL WHERE `causer-id` = 0")) {
+               return Update::FAILED;
+       }
+       if (!DBA::e("UPDATE `post-thread-user` SET `causer-id` = NULL WHERE `causer-id` = 0")) {
+               return Update::FAILED;
        }
+
        return Update::SUCCESS;
 }
+
+function update_1413()
+{
+       if (!DBA::e("UPDATE `post-user` SET `post-reason` = `post-type` WHERE `post-type` >= 64 and `post-type` <= 75")) {
+               return Update::FAILED;
+       }
+}