aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r--Zotlabs/Update/_1239.php27
-rw-r--r--Zotlabs/Update/_1240.php34
2 files changed, 61 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1239.php b/Zotlabs/Update/_1239.php
new file mode 100644
index 000000000..ed8de30bb
--- /dev/null
+++ b/Zotlabs/Update/_1239.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1239 {
+
+ function run() {
+
+ dbq("START TRANSACTION");
+
+ // remove broken activitypub hubloc entries
+ $r = dbq("DELETE FROM hubloc WHERE hubloc_network = 'activitypub' and hubloc_callback = ''");
+
+ // remove broken hubloc entries from friendica
+ $r1 = dbq("DELETE FROM hubloc WHERE hubloc_hash = ''");
+
+ if($r && $r1) {
+ dbq("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ dbq("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}
diff --git a/Zotlabs/Update/_1240.php b/Zotlabs/Update/_1240.php
new file mode 100644
index 000000000..d007c9fa9
--- /dev/null
+++ b/Zotlabs/Update/_1240.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1240 {
+
+ function run() {
+
+ q("START TRANSACTION");
+
+ // remove broken xchan entries
+ $r0 = dbq("DELETE FROM xchan WHERE xchan_hash = ''");
+
+ // remove broken hubloc entries
+ $r1 = dbq("DELETE FROM hubloc WHERE hubloc_hash = ''");
+
+ // fix legacy zot hubloc_id_url
+ $r2 = dbq("UPDATE hubloc
+ SET hubloc_id_url = CONCAT(hubloc_url, '/channel/', SUBSTRING(hubloc_addr FROM 1 FOR POSITION('@' IN hubloc_addr) -1))
+ WHERE hubloc_network = 'zot'
+ AND hubloc_id_url = ''"
+ );
+
+ if($r0 && $r1 && $r2) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}