Skip to content
Snippets Groups Projects
Commit 4afcae8d authored by Bart Visscher's avatar Bart Visscher
Browse files

Gallery: Fix database creation on update, also only from version less then 0.5

parent 0575d149
No related branches found
No related tags found
No related merge requests found
<?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');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment