aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-12-17 13:27:11 +0100
committerMario Vavti <mario@mariovavti.com>2020-12-17 13:27:11 +0100
commit34a58369f2c16a1c13b0ee2a6ab7418e72809d64 (patch)
treeeb7ebec5e6d4a854a27ce9cefaefd0888290864f /Zotlabs
parent59b4764a151ff6dc87f0c12b018961a7084ad040 (diff)
downloadvolse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.tar.gz
volse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.tar.bz2
volse-hubzilla-34a58369f2c16a1c13b0ee2a6ab7418e72809d64.zip
update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a0618775167fd5c5b8c91b80f8a832da0
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Update/_1240.php34
1 files changed, 34 insertions, 0 deletions
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;
+
+ }
+
+}