You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/core/Migrations/Version23000Date20210906132...

51 lines
1.4 KiB
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\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version23000Date20210906132259 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 {
/**
* Table was missing a primary key
* Therefore it was dropped with Version24000Date20211213081506
* and then recreated with a primary key in Version24000Date20211213081604
*/
// /** @var ISchemaWrapper $schema */
// $schema = $schemaClosure();
//
// $hasTable = $schema->hasTable(self::TABLE_NAME);
//
// if (!$hasTable) {
// $table = $schema->createTable(self::TABLE_NAME);
// $table->addColumn('hash', Types::STRING, [
// 'notnull' => true,
// 'length' => 128,
// ]);
// $table->addColumn('delete_after', Types::DATETIME, [
// 'notnull' => true,
// ]);
// $table->addIndex(['hash'], 'ratelimit_hash');
// $table->addIndex(['delete_after'], 'ratelimit_delete_after');
// return $schema;
// }
return null;
}
}