-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooklibrary.install
127 lines (116 loc) · 2.36 KB
/
booklibrary.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
<?php
// $Id$
/**
* Install the bookLibrary module
* @file
*/
/**
* Implementation of hook_install().
*/
function bookLibrary_install() {
drupal_install_schema('bookLibrary');
}
/**
* Implementation of hook_uninstall().
*/
function bookLibrary_uninstall() {
drupal_uninstall_schema('bookLibrary');
}
/**
* Implementation of hook_scheme().
*
* @return $schema
*/
function bookLibrary_schema() {
$schema['bookLibrary'] = array(
'fields' => array(
'bid' => array(
'type' => 'serial',
'unsigned' => true,
'not null' => true,
),
'isbn' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'title' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'subtitle' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'author' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'publishers' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'image_small' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'image_medium' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'image_large' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'pages_total' => array(
'type' => 'int',
'not null' => true,
'default' => 0,
),
'publication_date' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'book_link' => array(
'type' => 'varchar',
'length' => 255,
'not null' => true,
'default' => '',
),
'review' => array(
'type' => 'text',
'size' => 'big',
'default' => '',
),
'recommended' => array(
'type' => 'int',
'unsigned' => true,
'size' => 'small',
'not null' => true,
'default' => 0,
),
),
'unique keys' => array(
'isbn' => array('isbn'),
),
'primary key' => array('bid'),
);
return $schema;
}