aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-09-18 13:43:02 +0200
committerMario <mario@mariovavti.com>2020-09-18 13:43:02 +0200
commite9227b0ffe5ab40e61ee083ae07bbaad278b190c (patch)
tree34f4d998a8054ec77ab65d85de664c5f7785d826 /Zotlabs
parent76a6e0b6fcda9ab87a8f6ec3ee8873d4fcdb4cd4 (diff)
parent9299aff2af7e1821ee4066c55b4a9e0a3ca900f5 (diff)
downloadvolse-hubzilla-e9227b0ffe5ab40e61ee083ae07bbaad278b190c.tar.gz
volse-hubzilla-e9227b0ffe5ab40e61ee083ae07bbaad278b190c.tar.bz2
volse-hubzilla-e9227b0ffe5ab40e61ee083ae07bbaad278b190c.zip
Merge branch 'dev' into 'dev'
Boost DB conversion speed to Z6 See merge request hubzilla/core!1872
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Z6trans.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/Zotlabs/Module/Z6trans.php b/Zotlabs/Module/Z6trans.php
index 58dc09a51..31132bbe3 100644
--- a/Zotlabs/Module/Z6trans.php
+++ b/Zotlabs/Module/Z6trans.php
@@ -71,13 +71,31 @@ class Z6trans extends Controller {
}
}
+
+ $zot = dbesc($zot_xchan);
+ $zot6 = dbesc($zot6_xchan);
+
+ // Item table
+ foreach(['owner_xchan', 'author_xchan'] as $x) {
+ $q .= sprintf("UPDATE item SET $x = '%s' WHERE $x = '%s';\r\n",
+ $zot6,
+ $zot
+ );
+ }
+ $q .= "UPDATE item SET source_xchan = replace(source_xchan, '$zot', '$zot6'), route = replace(route, '$zot', '$zot6'), allow_cid = replace(allow_cid, '$zot', '$zot6'), deny_cid = replace(deny_cid, '$zot', '$zot6');\r\n";
+
+ // photo table
+ $q .= "UPDATE photo SET xchan = replace(xchan, '$zot', '$zot6'), allow_cid = replace(allow_cid, '$zot', '$zot6'), deny_cid = replace(deny_cid, '$zot', '$zot6');\r\n";
+ // dreport table
+ $q .= "UPDATE dreport SET dreport_recip = '$zot6' WHERE dreport_recip = '$zot';\r\n";
+ $q .= "UPDATE dreport SET dreport_xchan = '$zot6' WHERE dreport_xchan = '$zot';\r\n";
}
if($q)
file_put_contents($path, $q);
- $o = '<h2>' . t('Update to Hubzilla 5.0 setp 2') . '</h2><br>';
+ $o = '<h2>' . t('Update to Hubzilla 5.0 step 2') . '</h2><br>';
$o .= '<h3>' . t('To complete the update please run') . '</h3>';
if(ACTIVE_DBTYPE == DBTYPE_MYSQL)
@@ -103,16 +121,16 @@ class Z6trans extends Controller {
'chatpresence' => ['cp_xchan'],
'chatroom' => ['allow_cid', 'deny_cid'],
'config' => ['v'],
- 'dreport' => ['dreport_recip', 'dreport_xchan'],
+// 'dreport' => ['dreport_recip', 'dreport_xchan'],
'event' => ['event_xchan', 'allow_cid', 'deny_cid'],
'iconfig' => ['v'],
- 'item' => ['owner_xchan', 'author_xchan', 'source_xchan', 'route', 'allow_cid', 'deny_cid'],
+// 'item' => ['owner_xchan', 'author_xchan', 'source_xchan', 'route', 'allow_cid', 'deny_cid'],
'mail' => ['from_xchan', 'to_xchan'],
'menu_item' => ['allow_cid', 'deny_cid'],
'obj' => ['allow_cid', 'deny_cid'],
'pconfig' => ['v'],
'pgrp_member' => ['xchan'],
- 'photo' => ['xchan', 'allow_cid', 'deny_cid'],
+// 'photo' => ['xchan', 'allow_cid', 'deny_cid'],
'source' => ['src_channel_xchan', 'src_xchan'],
'updates' => ['ud_hash'],
'xchat' => ['xchat_xchan'],