Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jan] Add indexes to searchable timeslice columns.
- Loading branch information
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Adds indexes to the columns that are used for searching. | ||
* | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (GPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/gpl. | ||
* | ||
* @author Jan Schneider <jan@horde.org> | ||
* @category Horde | ||
* @license http://www.horde.org/licenses/gpl GPL | ||
* @package Hermes | ||
*/ | ||
class HermesSearchIndexes extends Horde_Db_Migration_Base | ||
{ | ||
/** | ||
* Upgrade. | ||
*/ | ||
public function up() | ||
{ | ||
$this->addIndex('hermes_timeslices', 'clientjob_id'); | ||
$this->addIndex('hermes_timeslices', 'employee_id'); | ||
$this->addIndex('hermes_timeslices', 'jobtype_id'); | ||
$this->addIndex('hermes_timeslices', 'timeslice_isbillable'); | ||
$this->addIndex('hermes_timeslices', 'timeslice_date'); | ||
$this->addIndex('hermes_timeslices', 'timeslice_submitted'); | ||
$this->addIndex('hermes_timeslices', 'timeslice_exported'); | ||
$this->addIndex('hermes_timeslices', 'costobject_id'); | ||
} | ||
|
||
/** | ||
* Downgrade. | ||
*/ | ||
public function down() | ||
{ | ||
$this->removeIndex('hermes_timeslices', 'clientjob_id'); | ||
$this->removeIndex('hermes_timeslices', 'employee_id'); | ||
$this->removeIndex('hermes_timeslices', 'jobtype_id'); | ||
$this->removeIndex('hermes_timeslices', 'timeslice_isbillable'); | ||
$this->removeIndex('hermes_timeslices', 'timeslice_date'); | ||
$this->removeIndex('hermes_timeslices', 'timeslice_submitted'); | ||
$this->removeIndex('hermes_timeslices', 'timeslice_exported'); | ||
$this->removeIndex('hermes_timeslices', 'costobject_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters