From e621396139c8f445c869de2021715d4bcc70ef00 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Thu, 7 Dec 2023 13:31:09 +0100 Subject: [PATCH] Comment legacy file_metadata table migrations Signed-off-by: Louis Chemineau --- .../Version24000Date20220404230027.php | 36 ++++++++-------- .../Version27000Date20230309104325.php | 43 ++++++++++--------- .../Version27000Date20230309104802.php | 14 +++--- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/core/Migrations/Version24000Date20220404230027.php b/core/Migrations/Version24000Date20220404230027.php index 26af9a4c6cc..114fc27b899 100644 --- a/core/Migrations/Version24000Date20220404230027.php +++ b/core/Migrations/Version24000Date20220404230027.php @@ -40,26 +40,26 @@ class Version24000Date20220404230027 extends SimpleMigrationStep { * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { - /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); + // /** @var ISchemaWrapper $schema */ + // $schema = $schemaClosure(); - if (!$schema->hasTable('file_metadata')) { - $table = $schema->createTable('file_metadata'); - $table->addColumn('id', Types::BIGINT, [ - 'notnull' => true, - ]); - $table->addColumn('group_name', Types::STRING, [ - 'notnull' => true, - 'length' => 50, - ]); - $table->addColumn('value', Types::TEXT, [ - 'notnull' => false, - 'default' => '', - ]); - $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx'); + // if (!$schema->hasTable('file_metadata')) { + // $table = $schema->createTable('file_metadata'); + // $table->addColumn('id', Types::BIGINT, [ + // 'notnull' => true, + // ]); + // $table->addColumn('group_name', Types::STRING, [ + // 'notnull' => true, + // 'length' => 50, + // ]); + // $table->addColumn('value', Types::TEXT, [ + // 'notnull' => false, + // 'default' => '', + // ]); + // $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx'); - return $schema; - } + // return $schema; + // } return null; } diff --git a/core/Migrations/Version27000Date20230309104325.php b/core/Migrations/Version27000Date20230309104325.php index 4708dc33717..53852731c0d 100644 --- a/core/Migrations/Version27000Date20230309104325.php +++ b/core/Migrations/Version27000Date20230309104325.php @@ -50,19 +50,20 @@ class Version27000Date20230309104325 extends SimpleMigrationStep { * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { - /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); - $metadataTable = $schema->getTable('file_metadata'); + // /** @var ISchemaWrapper $schema */ + // $schema = $schemaClosure(); + // $metadataTable = $schema->getTable('file_metadata'); - if ($metadataTable->hasColumn('value')) { - return null; - } + // if ($metadataTable->hasColumn('value')) { + // return null; + // } - $metadataTable->addColumn('value', Types::TEXT, [ - 'notnull' => false, - 'default' => '', - ]); - return $schema; + // $metadataTable->addColumn('value', Types::TEXT, [ + // 'notnull' => false, + // 'default' => '', + // ]); + // return $schema; + return null; } @@ -74,17 +75,17 @@ class Version27000Date20230309104325 extends SimpleMigrationStep { */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); - $metadataTable = $schema->getTable('file_metadata'); + // $schema = $schemaClosure(); + // $metadataTable = $schema->getTable('file_metadata'); - if (!$metadataTable->hasColumn('metadata')) { - return; - } + // if (!$metadataTable->hasColumn('metadata')) { + // return; + // } - $this->connection - ->getQueryBuilder() - ->update('file_metadata') - ->set('value', 'metadata') - ->executeStatement(); + // $this->connection + // ->getQueryBuilder() + // ->update('file_metadata') + // ->set('value', 'metadata') + // ->executeStatement(); } } diff --git a/core/Migrations/Version27000Date20230309104802.php b/core/Migrations/Version27000Date20230309104802.php index 4bd50fe0396..260ae83d970 100644 --- a/core/Migrations/Version27000Date20230309104802.php +++ b/core/Migrations/Version27000Date20230309104802.php @@ -43,14 +43,14 @@ class Version27000Date20230309104802 extends SimpleMigrationStep { * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { - /** @var ISchemaWrapper $schema */ - $schema = $schemaClosure(); - $metadataTable = $schema->getTable('file_metadata'); + // /** @var ISchemaWrapper $schema */ + // $schema = $schemaClosure(); + // $metadataTable = $schema->getTable('file_metadata'); - if ($metadataTable->hasColumn('metadata')) { - $metadataTable->dropColumn('metadata'); - return $schema; - } + // if ($metadataTable->hasColumn('metadata')) { + // $metadataTable->dropColumn('metadata'); + // return $schema; + // } return null; }