diff --git a/core/Application.php b/core/Application.php index a6c64e81b84..77cd221bb83 100644 --- a/core/Application.php +++ b/core/Application.php @@ -187,6 +187,9 @@ class Application extends App { if (!$table->hasIndex('properties_path_index')) { $subject->addHintForMissingSubject($table->getName(), 'properties_path_index'); } + if (!$table->hasIndex('properties_pathonly_index')) { + $subject->addHintForMissingSubject($table->getName(), 'properties_pathonly_index'); + } } } ); diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 1acff55fa40..824c7073bd3 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -301,11 +301,24 @@ class AddMissingIndices extends Command { $output->writeln('Check indices of the oc_properties table.'); if ($schema->hasTable('properties')) { $table = $schema->getTable('properties'); + $propertiesUpdated = false; + if (!$table->hasIndex('properties_path_index')) { $output->writeln('Adding properties_path_index index to the oc_properties table, this can take some time...'); $table->addIndex(['userid', 'propertypath'], 'properties_path_index'); $this->connection->migrateToSchema($schema->getWrappedSchema()); + $propertiesUpdated = true; + } + if (!$table->hasIndex('properties_pathonly_index')) { + $output->writeln('Adding properties_pathonly_index index to the oc_properties table, this can take some time...'); + + $table->addIndex(['propertypath'], 'properties_pathonly_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $propertiesUpdated = true; + } + + if ($propertiesUpdated) { $updated = true; $output->writeln('oc_properties table updated successfully.'); } diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index 4912bef8857..b020effe5aa 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -357,6 +357,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { $table->setPrimaryKey(['id']); $table->addIndex(['userid'], 'property_index'); $table->addIndex(['userid', 'propertypath'], 'properties_path_index'); + $table->addIndex(['propertypath'], 'properties_pathonly_index'); } else { $table = $schema->getTable('properties'); if ($table->hasColumn('propertytype')) {