Skip to content

Commit 1934529

Browse files
artongebackportbot-nextcloud[bot]
authored andcommitted
Comment legacy file_metadata table migrations
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 1675c79 commit 1934529

3 files changed

Lines changed: 47 additions & 46 deletions

File tree

core/Migrations/Version24000Date20220404230027.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ class Version24000Date20220404230027 extends SimpleMigrationStep {
4040
* @return null|ISchemaWrapper
4141
*/
4242
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43-
/** @var ISchemaWrapper $schema */
44-
$schema = $schemaClosure();
43+
// /** @var ISchemaWrapper $schema */
44+
// $schema = $schemaClosure();
4545

46-
if (!$schema->hasTable('file_metadata')) {
47-
$table = $schema->createTable('file_metadata');
48-
$table->addColumn('id', Types::BIGINT, [
49-
'notnull' => true,
50-
]);
51-
$table->addColumn('group_name', Types::STRING, [
52-
'notnull' => true,
53-
'length' => 50,
54-
]);
55-
$table->addColumn('value', Types::TEXT, [
56-
'notnull' => false,
57-
'default' => '',
58-
]);
59-
$table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx');
46+
// if (!$schema->hasTable('file_metadata')) {
47+
// $table = $schema->createTable('file_metadata');
48+
// $table->addColumn('id', Types::BIGINT, [
49+
// 'notnull' => true,
50+
// ]);
51+
// $table->addColumn('group_name', Types::STRING, [
52+
// 'notnull' => true,
53+
// 'length' => 50,
54+
// ]);
55+
// $table->addColumn('value', Types::TEXT, [
56+
// 'notnull' => false,
57+
// 'default' => '',
58+
// ]);
59+
// $table->setPrimaryKey(['id', 'group_name'], 'file_metadata_idx');
6060

61-
return $schema;
62-
}
61+
// return $schema;
62+
// }
6363

6464
return null;
6565
}

core/Migrations/Version27000Date20230309104325.php

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@ public function __construct(
5050
* @return null|ISchemaWrapper
5151
*/
5252
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
53-
/** @var ISchemaWrapper $schema */
54-
$schema = $schemaClosure();
55-
$metadataTable = $schema->getTable('file_metadata');
53+
// /** @var ISchemaWrapper $schema */
54+
// $schema = $schemaClosure();
55+
// $metadataTable = $schema->getTable('file_metadata');
5656

57-
if ($metadataTable->hasColumn('value')) {
58-
return null;
59-
}
57+
// if ($metadataTable->hasColumn('value')) {
58+
// return null;
59+
// }
6060

61-
$metadataTable->addColumn('value', Types::TEXT, [
62-
'notnull' => false,
63-
'default' => '',
64-
]);
65-
return $schema;
61+
// $metadataTable->addColumn('value', Types::TEXT, [
62+
// 'notnull' => false,
63+
// 'default' => '',
64+
// ]);
65+
// return $schema;
66+
return null;
6667
}
6768

6869

@@ -74,17 +75,17 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
7475
*/
7576
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
7677
/** @var ISchemaWrapper $schema */
77-
$schema = $schemaClosure();
78-
$metadataTable = $schema->getTable('file_metadata');
78+
// $schema = $schemaClosure();
79+
// $metadataTable = $schema->getTable('file_metadata');
7980

80-
if (!$metadataTable->hasColumn('metadata')) {
81-
return;
82-
}
81+
// if (!$metadataTable->hasColumn('metadata')) {
82+
// return;
83+
// }
8384

84-
$this->connection
85-
->getQueryBuilder()
86-
->update('file_metadata')
87-
->set('value', 'metadata')
88-
->executeStatement();
85+
// $this->connection
86+
// ->getQueryBuilder()
87+
// ->update('file_metadata')
88+
// ->set('value', 'metadata')
89+
// ->executeStatement();
8990
}
9091
}

core/Migrations/Version27000Date20230309104802.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ class Version27000Date20230309104802 extends SimpleMigrationStep {
4343
* @return null|ISchemaWrapper
4444
*/
4545
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
46-
/** @var ISchemaWrapper $schema */
47-
$schema = $schemaClosure();
48-
$metadataTable = $schema->getTable('file_metadata');
46+
// /** @var ISchemaWrapper $schema */
47+
// $schema = $schemaClosure();
48+
// $metadataTable = $schema->getTable('file_metadata');
4949

50-
if ($metadataTable->hasColumn('metadata')) {
51-
$metadataTable->dropColumn('metadata');
52-
return $schema;
53-
}
50+
// if ($metadataTable->hasColumn('metadata')) {
51+
// $metadataTable->dropColumn('metadata');
52+
// return $schema;
53+
// }
5454

5555
return null;
5656
}

0 commit comments

Comments
 (0)