Skip to content

Commit 92fd226

Browse files
committed
feat(files_sharing): Add indexes for target on share and share_external
Signed-off-by: Salvatore Martire <[email protected]> Signed-off-by: Louis Chmn <[email protected]>
1 parent 3870170 commit 92fd226

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

apps/files_sharing/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Turning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation.
1515

1616
</description>
17-
<version>1.25.1</version>
17+
<version>1.25.2</version>
1818
<licence>agpl</licence>
1919
<author>Michael Gapczynski</author>
2020
<author>Bjoern Schiessle</author>

apps/files_sharing/lib/Migration/Version11300Date20201120141438.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
8585
]);
8686
$table->setPrimaryKey(['id']);
8787
$table->addUniqueIndex(['user', 'mountpoint_hash'], 'sh_external_mp');
88+
$table->addIndex(['user', 'mountpoint'], 'user_mountpoint_index', [], ['lengths' => [null, 128]]);
8889
} else {
8990
$table = $schema->getTable('share_external');
9091
$remoteIdColumn = $table->getColumn('remote_id');

core/Listener/AddMissingIndicesListener.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,5 +210,19 @@ public function handle(Event $event): void {
210210
'unique_category_per_user',
211211
['uid', 'type', 'category']
212212
);
213+
214+
$event->addMissingIndex(
215+
'share',
216+
'share_with_file_target_index',
217+
['share_with', 'file_target'],
218+
['lengths' => [null, 128]]
219+
);
220+
221+
$event->addMissingIndex(
222+
'share_external',
223+
'user_mountpoint_index',
224+
['user', 'mountpoint'],
225+
['lengths' => [null, 128]]
226+
);
213227
}
214228
}

core/Migrations/Version13000Date20170718121200.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
454454
$table->addIndex(['file_source'], 'file_source_index');
455455
$table->addIndex(['token'], 'token_index');
456456
$table->addIndex(['share_with'], 'share_with_index');
457+
$table->addIndex(['share_with', 'file_target'], 'share_with_file_target_index', [], ['lengths' => [null, 128]]);
457458
$table->addIndex(['parent'], 'parent_index');
458459
$table->addIndex(['uid_owner'], 'owner_index');
459460
$table->addIndex(['uid_initiator'], 'initiator_index');

0 commit comments

Comments
 (0)