Merge pull request #59725 from nextcloud/backport/58734/stable33

This commit is contained in:
Kate 2026-04-20 15:07:51 +02:00 committed by GitHub
commit f138461bac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,11 +12,16 @@ namespace OC\Core\Listener;
use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IDBConnection;
/**
* @template-implements IEventListener<AddMissingIndicesEvent>
*/
class AddMissingIndicesListener implements IEventListener {
public function __construct(
private readonly IDBConnection $connection,
) {
}
public function handle(Event $event): void {
if (!($event instanceof AddMissingIndicesEvent)) {
@ -54,12 +59,14 @@ class AddMissingIndicesListener implements IEventListener {
'fs_size',
['size']
);
$event->addMissingIndex(
'filecache',
'fs_storage_path_prefix',
['storage', 'path'],
['lengths' => [null, 64]]
);
if ($this->connection->getDatabaseProvider() !== IDBConnection::PLATFORM_POSTGRES) {
$event->addMissingIndex(
'filecache',
'fs_storage_path_prefix',
['storage', 'path'],
['lengths' => [null, 64]]
);
}
$event->addMissingIndex(
'filecache',
'fs_parent',