From 004fcbbcc7609ca83807f2e38967ef54f469bf72 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 23 Jul 2016 21:24:54 +0200 Subject: Move to new directory structure --- upgrade/upgrade.php | 71 ----------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 upgrade/upgrade.php (limited to 'upgrade') diff --git a/upgrade/upgrade.php b/upgrade/upgrade.php deleted file mode 100644 index 2ddcddb2c..000000000 --- a/upgrade/upgrade.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright Bernhard Posselt 2015 - */ - -namespace OCA\News\Upgrade; - -use OCP\IConfig; -use OCA\News\Service\ItemService; -use OCP\IDBConnection; - -class Upgrade { - - /** @var IConfig */ - private $config; - - /** @var ItemService */ - private $itemService; - - private $appName; - /** - * @var IDBConnection - */ - private $db; - - /** - * Upgrade constructor. - * @param IConfig $config - * @param $appName - */ - public function __construct(IConfig $config, ItemService $itemService, - IDBConnection $db, $appName) { - $this->config = $config; - $this->appName = $appName; - $this->itemService = $itemService; - $this->db = $db; - } - - public function upgrade() { - $previousVersion = $this->config->getAppValue( - $this->appName, 'installed_version' - ); - - if (version_compare($previousVersion, '8.9.0', '<=')) { - $this->itemService->generateSearchIndices(); - } - } - - public function preUpgrade() { - $previousVersion = $this->config->getAppValue( - $this->appName, 'installed_version' - ); - - $dbType = $this->config->getSystemValue('dbtype'); - if (version_compare($previousVersion, '8.2.2', '<') && - $dbType !== 'sqlite3' - ) { - $sql = 'ALTER TABLE `*PREFIX*news_feeds` DROP COLUMN - `last_modified`'; - $query = $this->db->prepare($sql); - $query->execute(); - } - } - -} -- cgit v1.2.3