aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-12-17 13:27:11 +0100
committerMario <mario@mariovavti.com>2020-12-17 13:29:15 +0000
commit612448e4ae0a1595d698dff3dbbc442e94367c50 (patch)
tree310b5e652ab11745f71e0fbf4b473170dbb68236
parent82db19d54caf374963e0c6fa5f7391b10caf9ba8 (diff)
downloadvolse-hubzilla-612448e4ae0a1595d698dff3dbbc442e94367c50.tar.gz
volse-hubzilla-612448e4ae0a1595d698dff3dbbc442e94367c50.tar.bz2
volse-hubzilla-612448e4ae0a1595d698dff3dbbc442e94367c50.zip
update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a0618775167fd5c5b8c91b80f8a832da0
-rw-r--r--Zotlabs/Update/_1240.php34
-rwxr-xr-xboot.php4
2 files changed, 36 insertions, 2 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;
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index 8a1b86e27..c001c7572 100755
--- a/boot.php
+++ b/boot.php
@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '5.0.5' );
+define ( 'STD_VERSION', '5.0.6' );
define ( 'ZOT_REVISION', '6.0' );
-define ( 'DB_UPDATE_VERSION', 1239 );
+define ( 'DB_UPDATE_VERSION', 1240 );
define ( 'PROJECT_BASE', __DIR__ );