aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-20 21:53:39 -0700
committerzotlabs <mike@macgirvin.com>2017-03-20 21:53:39 -0700
commitb153c651b45842b0062c0b32a1a3816a1f06856c (patch)
tree58c36a7b6e3043d588d8d99e2fca8661dd7b85fb /include
parent8821986d87b36b8b5ea311bcb73d348dc0bed262 (diff)
downloadvolse-hubzilla-b153c651b45842b0062c0b32a1a3816a1f06856c.tar.gz
volse-hubzilla-b153c651b45842b0062c0b32a1a3816a1f06856c.tar.bz2
volse-hubzilla-b153c651b45842b0062c0b32a1a3816a1f06856c.zip
perform attach_upgrade()
Diffstat (limited to 'include')
-rw-r--r--include/attach.php23
1 files changed, 23 insertions, 0 deletions
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