2020-11-10 09:33:29 +01:00
|
|
|
<?php
|
2020-11-10 15:43:34 +01:00
|
|
|
|
2020-11-10 09:33:29 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
2024-05-24 19:43:47 +02:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-11-10 09:33:29 +01:00
|
|
|
*/
|
|
|
|
namespace OC\Core\Migrations;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
|
|
|
|
class Version20000Date20201109081919 extends SimpleMigrationStep {
|
|
|
|
/**
|
|
|
|
* @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();
|
|
|
|
|
|
|
|
if ($schema->hasTable('credentials')) {
|
|
|
|
$schema->dropTable('credentials');
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|