-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_list.install
115 lines (93 loc) · 2.53 KB
/
user_list.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
include_once 'includes/user_list.utils.inc';
include_once 'includes/user_list.search.inc';
include_once 'includes/user_list.fields.inc';
/**
*
* Implementation of hook_schema().
* @return array the created schema
*/
function user_list_schema() {
//table for saved searches
$schema[user_list_get_save_table_name()] = array(
'description' => 'Stores searches.',
'fields' => array(
'sid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary Key: Unique search ID.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Secondary Key: User ID who has saved the search.',
),
'name' => array(
'type' => 'varchar',
'length' => 55,
'default' => '',
'description' => 'Machine readable name of this search.',
),
'search' => array(
'type' => 'varchar',
'length' => 1024,
'default' => '',
'description' => 'The text of this search.',
),
'url' => array(
'type' => 'varchar',
'length' => 1024,
'default' => '',
'description' => 'The url before search is done.',
),
),
'primary key' => array('sid'),
'unique keys' => array('name' => array('name'))
);
//table for user data to hide
$schema[user_list_get_user_data_table_name()] = array(
'description' => 'Stores list of user data to be hidden.',
'fields' => array(
'data' => array(
'type' => 'varchar',
'length' => 1024,
'default' => '',
'description' => 'user data name.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'User ID who has saved the field data.',
),
),
);
//table for fields to hide
$schema[user_list_get_field_table_name()] = array(
'description' => 'Stores list of fields to be hidden.',
'fields' => array(
'fid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Field ID of the field.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'User ID who has saved the field data.',
),
),
);
return $schema;
}
/**
* Implementation of hook_uninstall().
*/
function user_list_uninstall() {
drupal_uninstall_schema('user_list');
}
?>