-
Notifications
You must be signed in to change notification settings - Fork 12
/
zmt_ui.install
36 lines (31 loc) · 920 Bytes
/
zmt_ui.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Implements hook_install().
*/
function zmt_ui_install() {
zmt_add_index_keys();
}
/**
* Implements hook_uninstall().
*/
function zmt_ui_uninstall() {
zmt_drop_index_keys();
}
/**
* Define index key for zimbra id.
*/
function zmt_add_index_keys() {
db_add_unique_key('zmt_domain', 'zmt_domain_zimbra_id', array('zimbra_id'));
db_add_unique_key('zmt_account', 'zmt_account_zimbra_id', array('zimbra_id'));
db_add_unique_key('zmt_group', 'zmt_group_zimbra_id', array('zimbra_id'));
db_add_index('zmt_alias', 'zmt_alias_zimbra_target_id', array('zimbra_target_id'));
}
/**
* Drop index key for zimbra id.
*/
function zmt_drop_index_keys() {
db_drop_unique_key('zmt_domain', 'zmt_domain_zimbra_id');
db_drop_unique_key('zmt_account', 'zmt_account_zimbra_id');
db_drop_unique_key('zmt_group', 'zmt_group_zimbra_id');
db_drop_index('zmt_alias', 'zmt_alias_zimbra_target_id');
}