-
Notifications
You must be signed in to change notification settings - Fork 2
/
usasearch.install
80 lines (71 loc) · 1.87 KB
/
usasearch.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* @file
* Install, update and uninstall functions for the usasearch module.
*/
/**
* Implements hook_update_N().
*/
function usasearch_update_1() {
variable_del('usasearch_affiliate_id');
variable_del('usasearch_discovery_tag');
}
/**
* Implements hook_uninstall().
*/
function usasearch_uninstall() {
variable_del('usasearch_affiliate_name');
variable_del('usasearch_action_domain');
variable_del('usasearch_search_page');
//variable_del('usasearch_node_type_include');
}
/**
* Implements hook_schema().
*/
function usasearch_schema()
{
$schema['digitalgovsearch'] = array(
'description' => 'Table used by USASearch to store node indexing preferences',
'fields' => array(
'nid' => array(
'description' => 'Node ID',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'search_include' => array(
'description' => 'Boolean field node indexing preference',
'type' => 'int',
'not null' => FALSE,
),
'index_status' => array(
'description' => 'Boolean field node indexing preference',
'type' => 'int',
'not null' => FALSE,
),
),
'primary key' => array('nid'),
);
}
/**
* Add {digitalgovsearch} table.
*/
function digitalgovsearch_update_7001() {
$schema = usasearch_schema();
if(!db_table_exists('digitalgovsearch'))
db_create_table('digitalgovsearch', $schema['digitalgovsearch']);
}
/**
* Add index_status field to the {digitalgovsearch} table.
*/
function usasearch_update_7002() {
db_add_field(
'digitalgovsearch',
'index_status',
array(
'description' => 'Boolean field node indexing preference',
'type' => 'int',
'not null' => FALSE,
)
);
}