-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maxence Lange <[email protected]>
- Loading branch information
1 parent
683ef89
commit 5929e7e
Showing
23 changed files
with
176 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2023 Maxence Lange <[email protected]> | ||
* @copyright 2023 Maxence Lange <[email protected]> | ||
* | ||
* @author Maxence Lange <[email protected]> | ||
* | ||
|
@@ -33,10 +32,10 @@ | |
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version28000Date20231004103301 extends SimpleMigrationStep { | ||
|
||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
$updated = false; | ||
|
||
if (!$schema->hasTable('files_metadata')) { | ||
$table = $schema->createTable('files_metadata'); | ||
|
@@ -53,6 +52,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt | |
|
||
$table->setPrimaryKey(['id']); | ||
$table->addUniqueIndex(['file_id'], 'files_meta_fileid'); | ||
$updated = true; | ||
} | ||
|
||
if (!$schema->hasTable('files_metadata_index')) { | ||
|
@@ -65,14 +65,17 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt | |
]); | ||
$table->addColumn('file_id', Types::BIGINT, ['notnull' => false, 'length' => 15]); | ||
$table->addColumn('meta_key', Types::STRING, ['notnull' => false, 'length' => 31]); | ||
$table->addColumn('meta_value', Types::STRING, ['notnull' => false, 'length' => 63]); | ||
$table->addColumn('meta_value_string', Types::STRING, ['notnull' => false, 'length' => 63]); | ||
$table->addColumn('meta_value_int', Types::BIGINT, ['notnull' => false, 'length' => 11]); | ||
// $table->addColumn('meta_value_float', Types::FLOAT, ['notnull' => false, 'length' => 11,5]); | ||
|
||
$table->setPrimaryKey(['id']); | ||
$table->addIndex(['file_id', 'meta_key', 'meta_value'], 'f_meta_index'); | ||
$table->addIndex(['file_id', 'meta_key', 'meta_value_string'], 'f_meta_index'); | ||
$table->addIndex(['file_id', 'meta_key', 'meta_value_int'], 'f_meta_index_i'); | ||
// $table->addIndex(['file_id', 'meta_key', 'meta_value_float'], 'f_meta_index_f'); | ||
$updated = true; | ||
} | ||
|
||
if (!$updated) { | ||
return null; | ||
} | ||
|
||
return $schema; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.