mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
fix(DB): Ignore intentionally missing fs_storage_path_prefix index on PostgreSQL
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
687d82843f
commit
8ae94242dc
1 changed files with 13 additions and 6 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue