This repository has been archived by the owner on Jun 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviews_saved_searches.install
67 lines (62 loc) · 1.76 KB
/
views_saved_searches.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
<?php
//$Id
function views_saved_searches_install() {
// install the schema
$results = drupal_install_schema('views_saved_searches');
// init variable that stores what views there are
// where they're located (urls)
// format: view_id => page display url
$views = array();
variable_set("views_saved_searches_view_names", $views);
}
function views_saved_searches_uninstall() {
//uninstall the schema
drupal_uninstall_schema('views_saved_searches');
}
function views_saved_searches_schema() {
$schema = array();
$schema['views_saved_searches'] = array(
'description' => 'Store views filter configurations for re-running at a later date',
'fields' => array(
'sid' => array(
'description' => 'The primary identifier for the search',
'type' => 'serial',
'unsigned' => TRUE,
'not_null' => TRUE,
),
'uid' => array(
'description' => 'The uid of the user that saved the search',
'type' => 'int',
'unsigned' => TRUE,
'not_null' => TRUE,
),
'view_name' => array(
'description' => 'The name of view that produces the search results',
'type' => 'varchar',
'length' => 255,
'not_null' => TRUE,
),
'search_name' => array(
'description' => 'The name the user gave the search',
'type' => 'varchar',
'length' => 255,
'not_null' => TRUE,
),
'search_query' => array(
'description' => 'The query string for the search',
'type' => 'text',
'size' => 'normal',
'not_null' => TRUE,
),
'timestamp' => array(
'description' => 'The time the search was saved',
'type' => 'int',
'not_null' => TRUE,
),
),
'indexes' => array(),
'unique keys' => array(),
'primary key' => array('sid'),
);
return $schema;
}