From d2633c3ad6c6e2a5830aa1ef773a6cce17617ac6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 25 Apr 2022 09:39:56 +0200 Subject: Fix older migrations to the version pattern Signed-off-by: Joas Schilling --- .../Migrations/Version240000Date20220202150027.php | 37 ------------- .../Migrations/Version240000Date20220404230027.php | 62 ---------------------- core/Migrations/Version24000Date20220202150027.php | 37 +++++++++++++ core/Migrations/Version24000Date20220404230027.php | 62 ++++++++++++++++++++++ lib/composer/composer/autoload_classmap.php | 4 +- lib/composer/composer/autoload_static.php | 4 +- lib/private/Metadata/FileMetadata.php | 2 +- 7 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 core/Migrations/Version240000Date20220202150027.php delete mode 100644 core/Migrations/Version240000Date20220404230027.php create mode 100644 core/Migrations/Version24000Date20220202150027.php create mode 100644 core/Migrations/Version24000Date20220404230027.php diff --git a/core/Migrations/Version240000Date20220202150027.php b/core/Migrations/Version240000Date20220202150027.php deleted file mode 100644 index b13afa67d1e..00000000000 --- a/core/Migrations/Version240000Date20220202150027.php +++ /dev/null @@ -1,37 +0,0 @@ -getTable('mounts'); - if (!$table->hasColumn('mount_provider_class')) { - $table->addColumn('mount_provider_class', Types::STRING, [ - 'notnull' => false, - 'length' => 128, - ]); - return $schema; - } - return null; - } -} diff --git a/core/Migrations/Version240000Date20220404230027.php b/core/Migrations/Version240000Date20220404230027.php deleted file mode 100644 index f45f8d5b500..00000000000 --- a/core/Migrations/Version240000Date20220404230027.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\Core\Migrations; - -use Closure; -use OCP\DB\ISchemaWrapper; -use OCP\DB\Types; -use OCP\Migration\IOutput; -use OCP\Migration\SimpleMigrationStep; - -/** - * Add oc_file_metadata table - * @see OC\Metadata\FileMetadata - */ -class Version240000Date20220404230027 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('file_metadata')) { - $table = $schema->createTable('file_metadata'); - $table->addColumn('id', Types::INTEGER, [ - 'notnull' => true, - ]); - $table->addColumn('group_name', Types::STRING, [ - 'notnull' => true, - 'length' => 50, - ]); - $table->addColumn('metadata', Types::JSON, [ - 'notnull' => true, - ]); - $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx'); - } - return $schema; - } -} diff --git a/core/Migrations/Version24000Date20220202150027.php b/core/Migrations/Version24000Date20220202150027.php new file mode 100644 index 00000000000..76a3ae8c73c --- /dev/null +++ b/core/Migrations/Version24000Date20220202150027.php @@ -0,0 +1,37 @@ +getTable('mounts'); + if (!$table->hasColumn('mount_provider_class')) { + $table->addColumn('mount_provider_class', Types::STRING, [ + 'notnull' => false, + 'length' => 128, + ]); + return $schema; + } + return null; + } +} diff --git a/core/Migrations/Version24000Date20220404230027.php b/core/Migrations/Version24000Date20220404230027.php new file mode 100644 index 00000000000..a650fcb7021 --- /dev/null +++ b/core/Migrations/Version24000Date20220404230027.php @@ -0,0 +1,62 @@ + + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OC\Core\Migrations; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +/** + * Add oc_file_metadata table + * @see \OC\Metadata\FileMetadata + */ +class Version24000Date20220404230027 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('file_metadata')) { + $table = $schema->createTable('file_metadata'); + $table->addColumn('id', Types::INTEGER, [ + 'notnull' => true, + ]); + $table->addColumn('group_name', Types::STRING, [ + 'notnull' => true, + 'length' => 50, + ]); + $table->addColumn('metadata', Types::JSON, [ + 'notnull' => true, + ]); + $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx'); + } + return $schema; + } +} diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 302b7b487a3..d00c7678999 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1021,14 +1021,14 @@ return array( 'OC\\Core\\Migrations\\Version23000Date20210930122352' => $baseDir . '/core/Migrations/Version23000Date20210930122352.php', 'OC\\Core\\Migrations\\Version23000Date20211203110726' => $baseDir . '/core/Migrations/Version23000Date20211203110726.php', 'OC\\Core\\Migrations\\Version23000Date20211213203940' => $baseDir . '/core/Migrations/Version23000Date20211213203940.php', - 'OC\\Core\\Migrations\\Version240000Date20220202150027' => $baseDir . '/core/Migrations/Version240000Date20220202150027.php', - 'OC\\Core\\Migrations\\Version240000Date20220404230027' => $baseDir . '/core/Migrations/Version240000Date20220404230027.php', 'OC\\Core\\Migrations\\Version24000Date20211210141942' => $baseDir . '/core/Migrations/Version24000Date20211210141942.php', 'OC\\Core\\Migrations\\Version24000Date20211213081506' => $baseDir . '/core/Migrations/Version24000Date20211213081506.php', 'OC\\Core\\Migrations\\Version24000Date20211213081604' => $baseDir . '/core/Migrations/Version24000Date20211213081604.php', 'OC\\Core\\Migrations\\Version24000Date20211222112246' => $baseDir . '/core/Migrations/Version24000Date20211222112246.php', 'OC\\Core\\Migrations\\Version24000Date20211230140012' => $baseDir . '/core/Migrations/Version24000Date20211230140012.php', 'OC\\Core\\Migrations\\Version24000Date20220131153041' => $baseDir . '/core/Migrations/Version24000Date20220131153041.php', + 'OC\\Core\\Migrations\\Version24000Date20220202150027' => $baseDir . '/core/Migrations/Version24000Date20220202150027.php', + 'OC\\Core\\Migrations\\Version24000Date20220404230027' => $baseDir . '/core/Migrations/Version24000Date20220404230027.php', 'OC\\Core\\Migrations\\Version24000Date20220425072957' => $baseDir . '/core/Migrations/Version24000Date20220425072957.php', 'OC\\Core\\Notification\\CoreNotifier' => $baseDir . '/core/Notification/CoreNotifier.php', 'OC\\Core\\Service\\LoginFlowV2Service' => $baseDir . '/core/Service/LoginFlowV2Service.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 7a90031daf0..2a3d653c7df 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1050,14 +1050,14 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Core\\Migrations\\Version23000Date20210930122352' => __DIR__ . '/../../..' . '/core/Migrations/Version23000Date20210930122352.php', 'OC\\Core\\Migrations\\Version23000Date20211203110726' => __DIR__ . '/../../..' . '/core/Migrations/Version23000Date20211203110726.php', 'OC\\Core\\Migrations\\Version23000Date20211213203940' => __DIR__ . '/../../..' . '/core/Migrations/Version23000Date20211213203940.php', - 'OC\\Core\\Migrations\\Version240000Date20220202150027' => __DIR__ . '/../../..' . '/core/Migrations/Version240000Date20220202150027.php', - 'OC\\Core\\Migrations\\Version240000Date20220404230027' => __DIR__ . '/../../..' . '/core/Migrations/Version240000Date20220404230027.php', 'OC\\Core\\Migrations\\Version24000Date20211210141942' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20211210141942.php', 'OC\\Core\\Migrations\\Version24000Date20211213081506' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20211213081506.php', 'OC\\Core\\Migrations\\Version24000Date20211213081604' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20211213081604.php', 'OC\\Core\\Migrations\\Version24000Date20211222112246' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20211222112246.php', 'OC\\Core\\Migrations\\Version24000Date20211230140012' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20211230140012.php', 'OC\\Core\\Migrations\\Version24000Date20220131153041' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20220131153041.php', + 'OC\\Core\\Migrations\\Version24000Date20220202150027' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20220202150027.php', + 'OC\\Core\\Migrations\\Version24000Date20220404230027' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20220404230027.php', 'OC\\Core\\Migrations\\Version24000Date20220425072957' => __DIR__ . '/../../..' . '/core/Migrations/Version24000Date20220425072957.php', 'OC\\Core\\Notification\\CoreNotifier' => __DIR__ . '/../../..' . '/core/Notification/CoreNotifier.php', 'OC\\Core\\Service\\LoginFlowV2Service' => __DIR__ . '/../../..' . '/core/Service/LoginFlowV2Service.php', diff --git a/lib/private/Metadata/FileMetadata.php b/lib/private/Metadata/FileMetadata.php index c53f5d7f619..7d1db21cf39 100644 --- a/lib/private/Metadata/FileMetadata.php +++ b/lib/private/Metadata/FileMetadata.php @@ -30,7 +30,7 @@ use OCP\DB\Types; * @method void setGroupName(string $groupName) * @method string getMetadata() * @method void setMetadata(array $metadata) - * @see OC\Core\Migrations\Version240000Date20220404230027 + * @see \OC\Core\Migrations\Version240000Date20220404230027 */ class FileMetadata extends Entity { protected ?string $groupName = null; -- cgit v1.2.3