aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1238.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-12 08:29:54 +0000
committerMario <mario@mariovavti.com>2020-05-12 08:29:54 +0000
commit6ffdc1b64238f63d3739bb5639b2b4517f90aa34 (patch)
tree2b6ffbd3d43e2c599cb0639661ecd0969eaa2551 /Zotlabs/Update/_1238.php
parent22d8523e76f45532aa874eb2da78d9956e4b165e (diff)
downloadvolse-hubzilla-6ffdc1b64238f63d3739bb5639b2b4517f90aa34.tar.gz
volse-hubzilla-6ffdc1b64238f63d3739bb5639b2b4517f90aa34.tar.bz2
volse-hubzilla-6ffdc1b64238f63d3739bb5639b2b4517f90aa34.zip
update file
Diffstat (limited to 'Zotlabs/Update/_1238.php')
-rw-r--r--Zotlabs/Update/_1238.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1238.php b/Zotlabs/Update/_1238.php
new file mode 100644
index 000000000..428f7ce15
--- /dev/null
+++ b/Zotlabs/Update/_1238.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1238 {
+
+ function run() {
+
+ q("START TRANSACTION");
+
+ $r = q("DELETE FROM app WHERE app_name = '%s'",
+ dbesc('Premium Channel')
+ );
+
+ // fix legacy zot hubloc_id_url
+ $r1 = q("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 = ''"
+ );
+
+ // fix singleton networks hubloc_id_url
+ $r2 = q("UPDATE hubloc
+ LEFT JOIN xchan ON hubloc_hash = xchan_hash
+ SET hubloc_id_url = xchan_url
+ WHERE hubloc_network IN ('activitypub', 'diaspora', 'friendica-over-diaspora', 'gnusoc')
+ AND hubloc_id_url = ''
+ AND xchan_url != ''"
+ );
+
+ if($r1 && $r2) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}