File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212use OCP \DB \Events \AddMissingIndicesEvent ;
1313use OCP \EventDispatcher \Event ;
1414use OCP \EventDispatcher \IEventListener ;
15+ use OCP \IDBConnection ;
1516
1617/**
1718 * @template-implements IEventListener<AddMissingIndicesEvent>
1819 */
1920class AddMissingIndicesListener implements IEventListener {
21+ public function __construct (
22+ private readonly IDBConnection $ connection ,
23+ ) {
24+ }
2025
2126 public function handle (Event $ event ): void {
2227 if (!($ event instanceof AddMissingIndicesEvent)) {
@@ -54,12 +59,14 @@ public function handle(Event $event): void {
5459 'fs_size ' ,
5560 ['size ' ]
5661 );
57- $ event ->addMissingIndex (
58- 'filecache ' ,
59- 'fs_storage_path_prefix ' ,
60- ['storage ' , 'path ' ],
61- ['lengths ' => [null , 64 ]]
62- );
62+ if ($ this ->connection ->getDatabaseProvider () !== IDBConnection::PLATFORM_POSTGRES ) {
63+ $ event ->addMissingIndex (
64+ 'filecache ' ,
65+ 'fs_storage_path_prefix ' ,
66+ ['storage ' , 'path ' ],
67+ ['lengths ' => [null , 64 ]]
68+ );
69+ }
6370 $ event ->addMissingIndex (
6471 'filecache ' ,
6572 'fs_parent ' ,
You can’t perform that action at this time.
0 commit comments