diff options
author | Max Kostikov <max@kostikov.co> | 2020-09-17 21:25:55 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-09-19 22:33:05 +0200 |
commit | d945789e1bcfd21530e7d1667b217e3596b447ce (patch) | |
tree | 1cd8d47d16c453310733020ed8b90213382c10c9 /Zotlabs/Module | |
parent | de306cd7b8e00dde34ae537f763b3dc3dc28fb00 (diff) | |
download | volse-hubzilla-d945789e1bcfd21530e7d1667b217e3596b447ce.tar.gz volse-hubzilla-d945789e1bcfd21530e7d1667b217e3596b447ce.tar.bz2 volse-hubzilla-d945789e1bcfd21530e7d1667b217e3596b447ce.zip |
Boost DB conversion speed to Z6
(cherry picked from commit a9377d6a3f8156ed686f122f791a813caef2e93f)
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Z6trans.php | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Zotlabs/Module/Z6trans.php b/Zotlabs/Module/Z6trans.php index 0caf096c9..31132bbe3 100644 --- a/Zotlabs/Module/Z6trans.php +++ b/Zotlabs/Module/Z6trans.php @@ -71,7 +71,25 @@ 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) @@ -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'], |