mirror of
https://github.com/nextcloud/server.git
synced 2024-12-28 07:58:42 +00:00
5c49a54801
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
38 lines
957 B
PHP
38 lines
957 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OC\Core\Migrations;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
class Version23000Date20211203110726 extends SimpleMigrationStep {
|
|
private const TABLE_NAME = 'profile_config';
|
|
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
$table = $schema->getTable(self::TABLE_NAME);
|
|
if ($table->hasIndex('user_id')) {
|
|
$table->renameIndex('user_id', self::TABLE_NAME . '_user_id_idx');
|
|
return $schema;
|
|
}
|
|
return null;
|
|
}
|
|
}
|