summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Posselt <BernhardPosselt@users.noreply.github.com>2016-08-25 22:50:38 +0200
committerGitHub <noreply@github.com>2016-08-25 22:50:38 +0200
commit6236915770d8623e6228c15b0f3d2b126526093b (patch)
tree3837a74531787682f1643e419bd78849d6e10866 /lib
parentf096c85401aa9b77a4df6c4ff6b965fc8ea26a9a (diff)
Delete Upgrade.php
Diffstat (limited to 'lib')
-rw-r--r--lib/Upgrade/Upgrade.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/lib/Upgrade/Upgrade.php b/lib/Upgrade/Upgrade.php
deleted file mode 100644
index de2437954..000000000
--- a/lib/Upgrade/Upgrade.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @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();
- }
- }
-
-}