Skip to content

Commit 681e52f

Browse files
fixup! Add missing index for propertypath only queries against properties
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent 5261170 commit 681e52f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

core/Application.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ function (GenericEvent $event) use ($container) {
195195
if (!$table->hasIndex('properties_path_index')) {
196196
$subject->addHintForMissingSubject($table->getName(), 'properties_path_index');
197197
}
198+
if (!$table->hasIndex('properties_pathonly_index')) {
199+
$subject->addHintForMissingSubject($table->getName(), 'properties_pathonly_index');
200+
}
198201
}
199202

200203
if ($schema->hasTable('jobs')) {
@@ -203,13 +206,6 @@ function (GenericEvent $event) use ($container) {
203206
$subject->addHintForMissingSubject($table->getName(), 'job_lastcheck_reserved');
204207
}
205208
}
206-
207-
if ($schema->hasTable('properties')) {
208-
$table = $schema->getTable('properties');
209-
if (!$table->hasIndex('properties_pathonly_index')) {
210-
$subject->addHintForMissingSubject($table->getName(), 'properties_pathonly_index');
211-
}
212-
}
213209
}
214210
);
215211

core/Migrations/Version13000Date20170718121200.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
363363
$table->setPrimaryKey(['id']);
364364
$table->addIndex(['userid'], 'property_index');
365365
$table->addIndex(['userid', 'propertypath'], 'properties_path_index');
366+
$table->addIndex(['propertypath'], 'properties_pathonly_index');
366367
} else {
367368
$table = $schema->getTable('properties');
368369
if ($table->hasColumn('propertytype')) {

0 commit comments

Comments
 (0)