diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 21:07:24 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 21:07:24 -0700 |
commit | 669e1111187d1d1888358d833c62b5445a2b360b (patch) | |
tree | 993089b1e473d74a8e4bf0154a8f278988052b0d /install/update.php | |
parent | 360fda15e9be17cb9ae0638fc0c76a5642b03223 (diff) | |
download | volse-hubzilla-669e1111187d1d1888358d833c62b5445a2b360b.tar.gz volse-hubzilla-669e1111187d1d1888358d833c62b5445a2b360b.tar.bz2 volse-hubzilla-669e1111187d1d1888358d833c62b5445a2b360b.zip |
add timestamps for syncing apps
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/install/update.php b/install/update.php index d0a0454fb..8e531b595 100644 --- a/install/update.php +++ b/install/update.php @@ -1779,8 +1779,22 @@ function update_r1149() { function update_r1150() { - // hubzilla update does not apply here, but we're keeping the numbers in sync - return UPDATE_SUCCESS; + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE app ADD app_created timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', + ADD app_edited timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + } + else { + $r1 = q("ALTER TABLE app ADD app_created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + ADD app_edited DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + } + + $r2 = q("create index app_created on app ( app_created ) "); + $r3 = q("create index app_edited on app ( app_edited ) "); + + $r = $r1 && $r2 && $r3; + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; } |