mirror of
https://github.com/nextcloud/server.git
synced 2025-01-31 06:43:12 +00:00
8d8891c5bc
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
43 lines
1,010 B
PHP
43 lines
1,010 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
namespace OCA\UserStatus\Migration;
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
/**
|
|
* @package OCA\UserStatus\Migration
|
|
*/
|
|
class Version1003Date20210809144824 extends SimpleMigrationStep {
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
* @since 23.0.0
|
|
*/
|
|
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
$statusTable = $schema->getTable('user_status');
|
|
|
|
if (!$statusTable->hasColumn('is_backup')) {
|
|
$statusTable->addColumn('is_backup', Types::BOOLEAN, [
|
|
'notnull' => false,
|
|
'default' => false,
|
|
]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
}
|