mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-11 16:32:55 +00:00
Conversation Mapper addition + migration to proper scheme
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2016
|
||||
*/
|
||||
|
||||
|
||||
namespace OCA\OcSms\Migration;
|
||||
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\IRepairStep;
|
||||
|
||||
use \OCA\OcSms\Db\ConversationStateMapper;
|
||||
|
||||
class FixConversationReadStates implements IRepairStep {
|
||||
|
||||
private $userManager;
|
||||
private $convStateMapper;
|
||||
|
||||
/**
|
||||
* FixConversationReadStates constructor.
|
||||
*
|
||||
* @param IUserManager $userManager
|
||||
*/
|
||||
public function __construct(ConversationStateMapper $mapper, IUserManager $userManager) {
|
||||
$this->userManager = $userManager;
|
||||
$this->convStateMapper = $mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function getName() {
|
||||
return 'Migrate legacy conversation reading states';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function run(IOutput $output) {
|
||||
|
||||
$output->startProgress();
|
||||
$output->advance(1, "Migrate states");
|
||||
$this->convStateMapper->migrate();
|
||||
$output->finishProgress();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user