-
Notifications
You must be signed in to change notification settings - Fork 1
/
enacast.install
executable file
·163 lines (156 loc) · 3.43 KB
/
enacast.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
/**
* @file
* Install, update, and uninstall functions for the Enacast module.
*/
/**
* Implements hook_field_schema().
*/
function enacast_field_schema($field) {
switch ($field['type']) {
case 'enacast_program':
$columns = array(
'value' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE
),
);
break;
case 'enacast_radio':
$columns = array(
'value' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE
),
);
break;
case 'enacast_podcast':
$columns = array(
'value' => array(
'type' => 'int',
'not null' => FALSE
),
);
break;
}
return array(
'columns' => $columns,
);
}
/**
* Implementation of hook_schema().
*/
function enacast_schema() {
$schema['enacast_podcasts'] = array(
'description' => 'Base table for podcasts imported by Enacast',
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'id'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'pkid'=> array(
'type'=> 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'name'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'summary'=> array(
'type'=> 'text',
'size' => 'big',
'not null' => TRUE,
),
'audio'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'program_codename'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'program_name'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'radio_codename'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'radio_name'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'utc_datetime'=> array(
'type'=> 'datetime',
'not null' => TRUE,
),
'datetime_tz'=> array(
'type'=> 'datetime',
'not null' => TRUE,
),
),
'primary key' => array('id'),
);
$schema['enacast_markers'] = array(
'description' => 'Markers for Enacasts podcasts',
'fields' => array(
'pid'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'pkid'=> array(
'type'=> 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'mid'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'descr'=> array(
'type'=> 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'startsecond' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('mid'),
);
return $schema;
}