From 414fd45de3d3c8dc71e6880f69e1fbc2f8bcc511 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 29 Oct 2024 13:40:42 +0100 Subject: [PATCH 1/2] perf: Add index for group_folders table Signed-off-by: provokateurin --- appinfo/info.xml | 2 +- .../Version19000Date20241029123147.php | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 lib/Migration/Version19000Date20241029123147.php diff --git a/appinfo/info.xml b/appinfo/info.xml index 0a437ecb3..94a504367 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ Folders can be configured from *Group folders* in the admin settings. After a folder is created, the admin can give access to the folder to one or more groups, control their write/sharing permissions and assign a quota for the folder. Note: Encrypting the contents of group folders is currently not supported.]]> - 17.0.8 + 17.0.9 agpl Robin Appelman GroupFolders diff --git a/lib/Migration/Version19000Date20241029123147.php b/lib/Migration/Version19000Date20241029123147.php new file mode 100644 index 000000000..f53beaa88 --- /dev/null +++ b/lib/Migration/Version19000Date20241029123147.php @@ -0,0 +1,37 @@ +hasTable('group_folders')) { + $table = $schema->getTable('group_folders'); + if (!$table->hasIndex('gf_folders_folder_id')) { + $table->addUniqueIndex(['folder_id'], 'gf_folders_folder_id'); + } + } + + return $schema; + } +} From 42183a4c3b8d3afacc80d2d125aa2e9ad9b5dcbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 9 Jan 2025 15:06:07 +0100 Subject: [PATCH 2/2] fix: Only return $schema if there was changes in migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/Migration/Version19000Date20241029123147.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Migration/Version19000Date20241029123147.php b/lib/Migration/Version19000Date20241029123147.php index f53beaa88..00348cea0 100644 --- a/lib/Migration/Version19000Date20241029123147.php +++ b/lib/Migration/Version19000Date20241029123147.php @@ -16,10 +16,7 @@ class Version19000Date20241029123147 extends SimpleMigrationStep { /** - * @param IOutput $output * @param Closure(): ISchemaWrapper $schemaClosure - * @param array $options - * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ @@ -29,9 +26,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table = $schema->getTable('group_folders'); if (!$table->hasIndex('gf_folders_folder_id')) { $table->addUniqueIndex(['folder_id'], 'gf_folders_folder_id'); + return $schema; } } - return $schema; + return null; } }