From 515f1e76b05c5b4544b7ee624d73cc3b7878d5ea Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 20 Mar 2017 21:53:39 -0700 Subject: perform attach_upgrade() --- include/attach.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/attach.php b/include/attach.php index 93401226d..c8582f8d3 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2320,3 +2320,26 @@ function attach_syspaths($channel_id,$attach_hash) { } + +function attach_upgrade() { + + $r = q("select id, uid, hash from attach where os_path = '' and display_path = '' limit 100"); + if($r) { + foreach($r as $rv) { + $x = attach_syspaths($rv['uid'],$rv['hash']); + if($x) { + $w = q("update attach set os_path = '%s', display_path = '%s' where id = %d", + dbesc($x['os_path']), + dbesc($x['path']), + intval($rv['id']) + ); + $y = q("update photo set os_path = '%s', display_path = '%s' where uid = %d and resource_id = '%s'", + dbesc($x['os_path']), + dbesc($x['path']), + intval($rv['uid']), + dbesc($rv['hash']) + ); + } + } + } +} \ No newline at end of file -- cgit v1.2.3