diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-07 23:38:50 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-07 23:38:50 +0200 |
commit | 4afcae8d56e880288124605a7b2a9890081601d5 (patch) | |
tree | ad02e35bf7ec243ad8c25e189d732a09cc41cdff /apps/gallery/appinfo | |
parent | 0575d149b4c0b83383395b931b418612a6e85a3b (diff) | |
download | nextcloud-server-4afcae8d56e880288124605a7b2a9890081601d5.tar.gz nextcloud-server-4afcae8d56e880288124605a7b2a9890081601d5.zip |
Gallery: Fix database creation on update, also only from version less then 0.5
Diffstat (limited to 'apps/gallery/appinfo')
-rw-r--r-- | apps/gallery/appinfo/update.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/gallery/appinfo/update.php b/apps/gallery/appinfo/update.php index dd248e21b3e..a0997ab5e86 100644 --- a/apps/gallery/appinfo/update.php +++ b/apps/gallery/appinfo/update.php @@ -1,9 +1,11 @@ <?php -$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos'); -$stmt->execute(); -$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums'); -$stmt->execute(); - -\OC_DB::createDbFromStructure('./database.xml'); +$currentVersion=OC_Appconfig::getValue('gallery', 'installed_version'); +if (version_compare($currentVersion, '0.5.0', '<')) { + $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos'); + $stmt->execute(); + $stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums'); + $stmt->execute(); + \OC_DB::createDbFromStructure(OC::$APPSROOT.'/apps/'.$appid.'/appinfo/database.xml'); +} |