Mercurial > defr > drupal > core
comparison modules/aggregator/aggregator.install @ 19:3edae6ecd6c6 6.9
Drupal 6.9
author | Franck Deroche <franck@defr.org> |
---|---|
date | Thu, 15 Jan 2009 10:15:56 +0100 |
parents | 4347c45bb494 |
children |
comparison
equal
deleted
inserted
replaced
18:f5131a9cd9e5 | 19:3edae6ecd6c6 |
---|---|
1 <?php | 1 <?php |
2 // $Id: aggregator.install,v 1.14.2.1 2008/11/09 13:22:35 goba Exp $ | 2 // $Id: aggregator.install,v 1.14.2.2 2009/01/06 15:46:36 goba Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * Implementation of hook_install(). | 5 * Implementation of hook_install(). |
6 */ | 6 */ |
7 function aggregator_install() { | 7 function aggregator_install() { |
25 /** | 25 /** |
26 * Implementation of hook_schema(). | 26 * Implementation of hook_schema(). |
27 */ | 27 */ |
28 function aggregator_schema() { | 28 function aggregator_schema() { |
29 $schema['aggregator_category'] = array( | 29 $schema['aggregator_category'] = array( |
30 'description' => t('Stores categories for aggregator feeds and feed items.'), | 30 'description' => 'Stores categories for aggregator feeds and feed items.', |
31 'fields' => array( | 31 'fields' => array( |
32 'cid' => array( | 32 'cid' => array( |
33 'type' => 'serial', | 33 'type' => 'serial', |
34 'not null' => TRUE, | 34 'not null' => TRUE, |
35 'description' => t('Primary Key: Unique aggregator category ID.'), | 35 'description' => 'Primary Key: Unique aggregator category ID.', |
36 ), | 36 ), |
37 'title' => array( | 37 'title' => array( |
38 'type' => 'varchar', | 38 'type' => 'varchar', |
39 'length' => 255, | 39 'length' => 255, |
40 'not null' => TRUE, | 40 'not null' => TRUE, |
41 'default' => '', | 41 'default' => '', |
42 'description' => t('Title of the category.'), | 42 'description' => 'Title of the category.', |
43 ), | 43 ), |
44 'description' => array( | 44 'description' => array( |
45 'type' => 'text', | 45 'type' => 'text', |
46 'not null' => TRUE, | 46 'not null' => TRUE, |
47 'size' => 'big', | 47 'size' => 'big', |
48 'description' => t('Description of the category'), | 48 'description' => 'Description of the category', |
49 ), | 49 ), |
50 'block' => array( | 50 'block' => array( |
51 'type' => 'int', | 51 'type' => 'int', |
52 'not null' => TRUE, | 52 'not null' => TRUE, |
53 'default' => 0, | 53 'default' => 0, |
54 'size' => 'tiny', | 54 'size' => 'tiny', |
55 'description' => t('The number of recent items to show within the category block.'), | 55 'description' => 'The number of recent items to show within the category block.', |
56 ) | 56 ) |
57 ), | 57 ), |
58 'primary key' => array('cid'), | 58 'primary key' => array('cid'), |
59 'unique keys' => array('title' => array('title')), | 59 'unique keys' => array('title' => array('title')), |
60 ); | 60 ); |
61 | 61 |
62 $schema['aggregator_category_feed'] = array( | 62 $schema['aggregator_category_feed'] = array( |
63 'description' => t('Bridge table; maps feeds to categories.'), | 63 'description' => 'Bridge table; maps feeds to categories.', |
64 'fields' => array( | 64 'fields' => array( |
65 'fid' => array( | 65 'fid' => array( |
66 'type' => 'int', | 66 'type' => 'int', |
67 'not null' => TRUE, | 67 'not null' => TRUE, |
68 'default' => 0, | 68 'default' => 0, |
69 'description' => t("The feed's {aggregator_feed}.fid."), | 69 'description' => "The feed's {aggregator_feed}.fid.", |
70 ), | 70 ), |
71 'cid' => array( | 71 'cid' => array( |
72 'type' => 'int', | 72 'type' => 'int', |
73 'not null' => TRUE, | 73 'not null' => TRUE, |
74 'default' => 0, | 74 'default' => 0, |
75 'description' => t('The {aggregator_category}.cid to which the feed is being assigned.'), | 75 'description' => 'The {aggregator_category}.cid to which the feed is being assigned.', |
76 ) | 76 ) |
77 ), | 77 ), |
78 'primary key' => array('cid', 'fid'), | 78 'primary key' => array('cid', 'fid'), |
79 'indexes' => array('fid' => array('fid')), | 79 'indexes' => array('fid' => array('fid')), |
80 ); | 80 ); |
81 | 81 |
82 $schema['aggregator_category_item'] = array( | 82 $schema['aggregator_category_item'] = array( |
83 'description' => t('Bridge table; maps feed items to categories.'), | 83 'description' => 'Bridge table; maps feed items to categories.', |
84 'fields' => array( | 84 'fields' => array( |
85 'iid' => array( | 85 'iid' => array( |
86 'type' => 'int', | 86 'type' => 'int', |
87 'not null' => TRUE, | 87 'not null' => TRUE, |
88 'default' => 0, | 88 'default' => 0, |
89 'description' => t("The feed item's {aggregator_item}.iid."), | 89 'description' => "The feed item's {aggregator_item}.iid.", |
90 ), | 90 ), |
91 'cid' => array( | 91 'cid' => array( |
92 'type' => 'int', | 92 'type' => 'int', |
93 'not null' => TRUE, | 93 'not null' => TRUE, |
94 'default' => 0, | 94 'default' => 0, |
95 'description' => t('The {aggregator_category}.cid to which the feed item is being assigned.'), | 95 'description' => 'The {aggregator_category}.cid to which the feed item is being assigned.', |
96 ) | 96 ) |
97 ), | 97 ), |
98 'primary key' => array('cid', 'iid'), | 98 'primary key' => array('cid', 'iid'), |
99 'indexes' => array('iid' => array('iid')), | 99 'indexes' => array('iid' => array('iid')), |
100 ); | 100 ); |
101 | 101 |
102 $schema['aggregator_feed'] = array( | 102 $schema['aggregator_feed'] = array( |
103 'description' => t('Stores feeds to be parsed by the aggregator.'), | 103 'description' => 'Stores feeds to be parsed by the aggregator.', |
104 'fields' => array( | 104 'fields' => array( |
105 'fid' => array( | 105 'fid' => array( |
106 'type' => 'serial', | 106 'type' => 'serial', |
107 'not null' => TRUE, | 107 'not null' => TRUE, |
108 'description' => t('Primary Key: Unique feed ID.'), | 108 'description' => 'Primary Key: Unique feed ID.', |
109 ), | 109 ), |
110 'title' => array( | 110 'title' => array( |
111 'type' => 'varchar', | 111 'type' => 'varchar', |
112 'length' => 255, | 112 'length' => 255, |
113 'not null' => TRUE, | 113 'not null' => TRUE, |
114 'default' => '', | 114 'default' => '', |
115 'description' => t('Title of the feed.'), | 115 'description' => 'Title of the feed.', |
116 ), | 116 ), |
117 'url' => array( | 117 'url' => array( |
118 'type' => 'varchar', | 118 'type' => 'varchar', |
119 'length' => 255, | 119 'length' => 255, |
120 'not null' => TRUE, | 120 'not null' => TRUE, |
121 'default' => '', | 121 'default' => '', |
122 'description' => t('URL to the feed.'), | 122 'description' => 'URL to the feed.', |
123 ), | 123 ), |
124 'refresh' => array( | 124 'refresh' => array( |
125 'type' => 'int', | 125 'type' => 'int', |
126 'not null' => TRUE, | 126 'not null' => TRUE, |
127 'default' => 0, | 127 'default' => 0, |
128 'description' => t('How often to check for new feed items, in seconds.'), | 128 'description' => 'How often to check for new feed items, in seconds.', |
129 ), | 129 ), |
130 'checked' => array( | 130 'checked' => array( |
131 'type' => 'int', | 131 'type' => 'int', |
132 'not null' => TRUE, | 132 'not null' => TRUE, |
133 'default' => 0, | 133 'default' => 0, |
134 'description' => t('Last time feed was checked for new items, as Unix timestamp.'), | 134 'description' => 'Last time feed was checked for new items, as Unix timestamp.', |
135 ), | 135 ), |
136 'link' => array( | 136 'link' => array( |
137 'type' => 'varchar', | 137 'type' => 'varchar', |
138 'length' => 255, | 138 'length' => 255, |
139 'not null' => TRUE, | 139 'not null' => TRUE, |
140 'default' => '', | 140 'default' => '', |
141 'description' => t('The parent website of the feed; comes from the <link> element in the feed.'), | 141 'description' => 'The parent website of the feed; comes from the <link> element in the feed.', |
142 ), | 142 ), |
143 'description' => array( | 143 'description' => array( |
144 'type' => 'text', | 144 'type' => 'text', |
145 'not null' => TRUE, | 145 'not null' => TRUE, |
146 'size' => 'big', | 146 'size' => 'big', |
147 'description' => t("The parent website's description; comes from the <description> element in the feed."), | 147 'description' => "The parent website's description; comes from the <description> element in the feed.", |
148 ), | 148 ), |
149 'image' => array( | 149 'image' => array( |
150 'type' => 'text', | 150 'type' => 'text', |
151 'not null' => TRUE, | 151 'not null' => TRUE, |
152 'size' => 'big', | 152 'size' => 'big', |
153 'description' => t('An image representing the feed.'), | 153 'description' => 'An image representing the feed.', |
154 ), | 154 ), |
155 'etag' => array( | 155 'etag' => array( |
156 'type' => 'varchar', | 156 'type' => 'varchar', |
157 'length' => 255, | 157 'length' => 255, |
158 'not null' => TRUE, | 158 'not null' => TRUE, |
159 'default' => '', | 159 'default' => '', |
160 'description' => t('Entity tag HTTP response header, used for validating cache.'), | 160 'description' => 'Entity tag HTTP response header, used for validating cache.', |
161 ), | 161 ), |
162 'modified' => array( | 162 'modified' => array( |
163 'type' => 'int', | 163 'type' => 'int', |
164 'not null' => TRUE, | 164 'not null' => TRUE, |
165 'default' => 0, | 165 'default' => 0, |
166 'description' => t('When the feed was last modified, as a Unix timestamp.'), | 166 'description' => 'When the feed was last modified, as a Unix timestamp.', |
167 ), | 167 ), |
168 'block' => array( | 168 'block' => array( |
169 'type' => 'int', | 169 'type' => 'int', |
170 'not null' => TRUE, | 170 'not null' => TRUE, |
171 'default' => 0, | 171 'default' => 0, |
172 'size' => 'tiny', | 172 'size' => 'tiny', |
173 'description' => t("Number of items to display in the feed's block."), | 173 'description' => "Number of items to display in the feed's block.", |
174 ) | 174 ) |
175 ), | 175 ), |
176 'primary key' => array('fid'), | 176 'primary key' => array('fid'), |
177 'unique keys' => array( | 177 'unique keys' => array( |
178 'url' => array('url'), | 178 'url' => array('url'), |
179 'title' => array('title'), | 179 'title' => array('title'), |
180 ), | 180 ), |
181 ); | 181 ); |
182 | 182 |
183 $schema['aggregator_item'] = array( | 183 $schema['aggregator_item'] = array( |
184 'description' => t('Stores the individual items imported from feeds.'), | 184 'description' => 'Stores the individual items imported from feeds.', |
185 'fields' => array( | 185 'fields' => array( |
186 'iid' => array( | 186 'iid' => array( |
187 'type' => 'serial', | 187 'type' => 'serial', |
188 'not null' => TRUE, | 188 'not null' => TRUE, |
189 'description' => t('Primary Key: Unique ID for feed item.'), | 189 'description' => 'Primary Key: Unique ID for feed item.', |
190 ), | 190 ), |
191 'fid' => array( | 191 'fid' => array( |
192 'type' => 'int', | 192 'type' => 'int', |
193 'not null' => TRUE, | 193 'not null' => TRUE, |
194 'default' => 0, | 194 'default' => 0, |
195 'description' => t('The {aggregator_feed}.fid to which this item belongs.'), | 195 'description' => 'The {aggregator_feed}.fid to which this item belongs.', |
196 ), | 196 ), |
197 'title' => array( | 197 'title' => array( |
198 'type' => 'varchar', | 198 'type' => 'varchar', |
199 'length' => 255, | 199 'length' => 255, |
200 'not null' => TRUE, | 200 'not null' => TRUE, |
201 'default' => '', | 201 'default' => '', |
202 'description' => t('Title of the feed item.'), | 202 'description' => 'Title of the feed item.', |
203 ), | 203 ), |
204 'link' => array( | 204 'link' => array( |
205 'type' => 'varchar', | 205 'type' => 'varchar', |
206 'length' => 255, | 206 'length' => 255, |
207 'not null' => TRUE, | 207 'not null' => TRUE, |
208 'default' => '', | 208 'default' => '', |
209 'description' => t('Link to the feed item.'), | 209 'description' => 'Link to the feed item.', |
210 ), | 210 ), |
211 'author' => array( | 211 'author' => array( |
212 'type' => 'varchar', | 212 'type' => 'varchar', |
213 'length' => 255, | 213 'length' => 255, |
214 'not null' => TRUE, | 214 'not null' => TRUE, |
215 'default' => '', | 215 'default' => '', |
216 'description' => t('Author of the feed item.'), | 216 'description' => 'Author of the feed item.', |
217 ), | 217 ), |
218 'description' => array( | 218 'description' => array( |
219 'type' => 'text', | 219 'type' => 'text', |
220 'not null' => TRUE, | 220 'not null' => TRUE, |
221 'size' => 'big', | 221 'size' => 'big', |
222 'description' => t('Body of the feed item.'), | 222 'description' => 'Body of the feed item.', |
223 ), | 223 ), |
224 'timestamp' => array( | 224 'timestamp' => array( |
225 'type' => 'int', | 225 'type' => 'int', |
226 'not null' => FALSE, | 226 'not null' => FALSE, |
227 'description' => t('Post date of feed item, as a Unix timestamp.'), | 227 'description' => 'Post date of feed item, as a Unix timestamp.', |
228 ), | 228 ), |
229 'guid' => array( | 229 'guid' => array( |
230 'type' => 'varchar', | 230 'type' => 'varchar', |
231 'length' => 255, | 231 'length' => 255, |
232 'not null' => FALSE, | 232 'not null' => FALSE, |
233 'description' => t('Unique identifier for the feed item.'), | 233 'description' => 'Unique identifier for the feed item.', |
234 ) | 234 ) |
235 ), | 235 ), |
236 'primary key' => array('iid'), | 236 'primary key' => array('iid'), |
237 'indexes' => array('fid' => array('fid')), | 237 'indexes' => array('fid' => array('fid')), |
238 ); | 238 ); |