Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ function (GenericEvent $event) use ($container) {
$subject->addHintForMissingSubject($table->getName(), 'schedulobj_principuri_index');
}
}

if ($schema->hasTable('properties')) {
$table = $schema->getTable('properties');
if (!$table->hasIndex('properties_path_index')) {
$subject->addHintForMissingSubject($table->getName(), 'properties_path_index');
}
}
}
);

Expand Down
14 changes: 14 additions & 0 deletions core/Command/Db/AddMissingIndices.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @author Robin Appelman <[email protected]>
* @author Roeland Jago Douma <[email protected]>
* @author Thomas Citharel <[email protected]>
* @author Mario Danic <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand Down Expand Up @@ -254,6 +255,19 @@ private function addCoreIndexes(OutputInterface $output) {
}
}

$output->writeln('<info>Check indices of the oc_properties table.</info>');
if ($schema->hasTable('properties')) {
$table = $schema->getTable('properties');
if (!$table->hasIndex('properties_path_index')) {
$output->writeln('<info>Adding properties_path_index index to the oc_properties table, this can take some time...</info>');

$table->addIndex(['userid', 'propertypath'], 'properties_path_index');
$this->connection->migrateToSchema($schema->getWrappedSchema());
$updated = true;
$output->writeln('<info>oc_properties table updated successfully.</info>');
}
}

if (!$updated) {
$output->writeln('<info>Done.</info>');
}
Expand Down
1 change: 1 addition & 0 deletions core/Migrations/Version13000Date20170718121200.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
]);
$table->setPrimaryKey(['id']);
$table->addIndex(['userid'], 'property_index');
$table->addIndex(['userid', 'propertypath'], 'properties_path_index');
}

if (!$schema->hasTable('share')) {
Expand Down