Gallery: Fix database creation on update, also only from version less then 0.5
This commit is contained in:
parent
0575d149b4
commit
4afcae8d56
|
@ -1,9 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos');
|
$currentVersion=OC_Appconfig::getValue('gallery', 'installed_version');
|
||||||
$stmt->execute();
|
if (version_compare($currentVersion, '0.5.0', '<')) {
|
||||||
$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums');
|
$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_photos');
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
$stmt = OCP\DB::prepare('DROP TABLE IF EXISTS *PREFIX*gallery_albums');
|
||||||
\OC_DB::createDbFromStructure('./database.xml');
|
$stmt->execute();
|
||||||
|
|
||||||
|
\OC_DB::createDbFromStructure(OC::$APPSROOT.'/apps/'.$appid.'/appinfo/database.xml');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue