-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathessential.install
131 lines (118 loc) · 3.1 KB
/
essential.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
/*
* This file is licensed under GPLv2+.
*/
/**
* @file
* Install, update and uninstall functions for the essential module.
*/
/**
* Implementation of hook_schema().
*/
function essential_schema() {
// province list
$schema['vl_province'] = array(
'description' => t('Provides base information for provinces'),
'fields' => array(
'pid' => array(
'type' => 'varchar',
'length' => '6',
'not null' => TRUE,
'default' => '000000',
'description' => t('Province ID as provided in GB 2260'),
),
'name' => array(
'type' => 'varchar',
'length' => '8',
'not null' => TRUE,
),
'simplified_name' => array(
'type' => 'varchar',
'length' => '3',
'not null' => TRUE,
),
'isgkenabled' => array(
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '1',
),
'ucategory' => array(
'type' => 'int',
'size' => 'tiny',
'not null' => FALSE,
'disp-width' => '1',
)
),
'primary key' => array('pid'),
'indexes' => array(
'isgkenabled' => array('isgkenabled'),
'name' => array('name')),
);
// city list
$schema['vl_city_district'] = array(
'fields' => array(
'cid' => array('type' => 'varchar', 'length' => '6', 'not null' => TRUE),
'pid' => array('type' => 'varchar', 'length' => '6', 'not null' => TRUE),
'name' => array('type' => 'varchar', 'length' => '200', 'not null' => TRUE),
'name_simp' => array('type' => 'varchar', 'length' => '20', 'not null' => TRUE)
),
'primary key' => array('cid'),
'indexes' => array(
'pid' => array('pid')),
);
// nationality list
$schema['vl_nationality'] = array(
'fields' => array(
'nid' => array('type' => 'varchar', 'length' => '2', 'not null' => TRUE),
'name' => array('type' => 'varchar', 'length' => '5', 'not null' => TRUE)
),
'primary key' => array('nid'),
);
// politics features list
$schema['vl_politics_features'] = array(
'fields' => array(
'pid' => array('type' => 'varchar', 'length' => '2', 'not null' => TRUE),
'name' => array('type' => 'varchar', 'length' => '7', 'not null' => TRUE)
),
'primary key' => array('pid'),
);
// department list
$schema['vl_department'] = array(
'fields' => array(
'did' => array(
'type' => 'varchar',
'length' => '4',
'not null' => TRUE,
),
'dname' => array(
'type' => 'varchar',
'length' => '20',
'not null' => TRUE,
),
'did_exchange' => array(
'description' => 'Exchange code for uniexchange',
'type' => 'varchar',
'length' => '10',
'not null' => TRUE,
),
),
'primary key' => array('did'),
'indexes' => array(
'dname' => array('dname'),
),
);
// research room list
$schema['vl_research_sec'] = array(
'fields' => array(
'uid' => array('type' => 'varchar', 'length' => '4', 'not null' => TRUE),
'rname' => array('type' => 'varchar', 'length' => '10', 'not null' => TRUE),
'did' => array('type' => 'varchar', 'length' => '2', 'not null' => TRUE)
),
'primary key' => array('uid'),
'indexes' => array(
'did' => array('did')),
);
return $schema;
}