Skip to content

Commit

Permalink
Drop activity_time index
Browse files Browse the repository at this point in the history
To avoid other queries prefering this index and being painfully slow.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Apr 16, 2019
1 parent 11f9e39 commit 4e0ccd9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
More information is available in the Activity documentation.
</description>

<version>2.10.0</version>
<version>2.10.1</version>
<licence>agpl</licence>
<author>Frank Karlitschek</author>
<author>Joas Schilling</author>
Expand Down
35 changes: 35 additions & 0 deletions lib/Migration/Version2010Date20190416112817.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);

namespace OCA\Activity\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;

/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version2010Date20190416112817 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->getTable('activity');

if ($table->hasIndex('activity_time')) {
$table->dropIndex('activity_time');
}

return $schema;
}

}

0 comments on commit 4e0ccd9

Please sign in to comment.