Skip to content

Commit

Permalink
[jan] Add indexes to searchable timeslice columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Mar 31, 2015
1 parent e470e4e commit 5e83b4e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions hermes/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v2.0-git
--------

[jan] Add indexes to searchable timeslice columns.
[mjr] Add ability to delete multiple slices at one time.
[mjr] Add confirmation dialog for deleting time slices (Request #10361).
[mjr] Implement exclusive timers (Request #12543).
Expand Down
46 changes: 46 additions & 0 deletions hermes/migration/3_hermes_search_indexes.php
@@ -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');
}
}
6 changes: 5 additions & 1 deletion hermes/package.xml
Expand Up @@ -22,7 +22,7 @@
<email>mrubinsk@horde.org</email>
<active>yes</active>
</lead>
<date>2013-11-26</date>
<date>2015-03-31</date>
<version>
<release>2.0.0</release>
<api>2.0.0</api>
Expand All @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsdl.php">BSD-2-Clause</license>
<notes>
* [jan] Add indexes to searchable timeslice columns.
* [mjr] Add ability to delete multiple slices at one time.
* [mjr] Add confirmation dialog for deleting time slices (Request #10361).
* [mjr] Implement exclusive timers (Request #12543).
Expand Down Expand Up @@ -173,6 +174,7 @@
<dir name="migration">
<file name="1_hermes_base_tables.php" role="horde" />
<file name="2_hermes_autoincrement.php" role="horde" />
<file name="3_hermes_search_indexes.php" role="horde" />
</dir> <!-- /migration -->
<dir name="templates">
<dir name="deliverables">
Expand Down Expand Up @@ -454,6 +456,7 @@
<install as="hermes/locale/zh_TW/LC_MESSAGES/hermes.po" name="locale/zh_TW/LC_MESSAGES/hermes.po" />
<install as="hermes/migration/1_hermes_base_tables.php" name="migration/1_hermes_base_tables.php" />
<install as="hermes/migration/2_hermes_autoincrement.php" name="migration/2_hermes_autoincrement.php" />
<install as="hermes/migration/3_hermes_search_indexes.php" name="migration/3_hermes_search_indexes.php" />
<install as="hermes/templates/deliverables/list.inc" name="templates/deliverables/list.inc" />
<install as="hermes/templates/dynamic/deliverabledetail.inc" name="templates/dynamic/deliverabledetail.inc" />
<install as="hermes/templates/dynamic/deliverables.inc" name="templates/dynamic/deliverables.inc" />
Expand Down Expand Up @@ -509,6 +512,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsdl.php">BSD-2-Clause</license>
<notes>
* [jan] Add indexes to searchable timeslice columns.
* [mjr] Add ability to delete multiple slices at one time.
* [mjr] Add confirmation dialog for deleting time slices (Request #10361).
* [mjr] Implement exclusive timers (Request #12543).
Expand Down

0 comments on commit 5e83b4e

Please sign in to comment.