Skip to content

Commit

Permalink
Stash migration experiment (nextcloud#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonologic committed Jul 11, 2017
1 parent f558e75 commit 0569f36
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
8 changes: 7 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Before you update to a new version, [check the changelog](https://github.com/nextcloud/news/blob/master/CHANGELOG.md) to avoid surprises.
**Important**: To enable feed updates you will need to enable either [Nextcloud system cron](https://docs.nextcloud.com/server/10/admin_manual/configuration_server/background_jobs_configuration.html#cron) or use [an updater](https://github.com/nextcloud/news-updater) which uses the built in update API and disable cron updates. More information can be found [in the README](https://github.com/nextcloud/news).]]></description>
<version>11.0.5</version>
<version>11.0.6</version>
<licence>agpl</licence>
<author>Bernhard Posselt</author>
<author>Alessandro Cosentino</author>
Expand Down Expand Up @@ -42,6 +42,12 @@ Before you update to a new version, [check the changelog](https://github.com/nex
<job>OCA\News\Cron\Updater</job>
</background-jobs>

<repair-steps>
<post-migration>
<step>OCA\News\Migration\MigrateStatusFlags</step>
</post-migration>
</repair-steps>

<settings>
<admin>OCA\News\Settings\Admin</admin>
<admin-section>OCA\News\Settings\Section</admin-section>
Expand Down
60 changes: 60 additions & 0 deletions lib/Migration/MigrateStatusFlags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* @copyright 2017 Koen Martens <gmc@sonologic.nl>
*
* @author Koen Martens <gmc@sonologic.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\News\Migration;

use OCP\Migration\IRepairStep;
use OCP\Migration\IOutput;

class MigrateStatusFlags implements IRepairStep {

/** @var IDBConnection */
private $db;

/** @var IJobList */
private $jobList;

/** @var IConfig */
private $config;

/**
* @param IDBConnection $db
* @param IJobList $jobList
* @param IConfig $config
*/
/* public function __construct(IDBConnection $db,
IJobList $jobList,
IConfig $config) {
$this->db = $db;
$this->jobList = $jobList;
$this->config = $config;
}*/

public function getName() {
return "Migrating status flags from binary encoded int column to boolean columns";
}

public function run(IOutput $output) {
$output->info($this->getName());
}

}

0 comments on commit 0569f36

Please sign in to comment.