/[drupal]/contributions/modules/order/order.install
ViewVC logotype

Contents of /contributions/modules/order/order.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Wed Aug 5 19:02:15 2009 UTC (3 months, 3 weeks ago) by vauxia
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +12 -71 lines
File MIME type: text/x-php
Beginning to refactor:  An ecommerce Order is an instance of pay_form_order,
which is a subclass of pay_form.  Thus, all of the configuration, available
payment methods, etc. are managed by the payment API, while 'cartiness'
is Order's sole domain.

Also, decoupling order_product items from nodes.  There's no longer a 1:1
relationship between nodes and products: Product definitions will be class-based
and have an (optional) one-to-many relationship from nodes. For my current needs
I will write a "simple" 1:1 node:product handler, but there's no reason you
couldn't write some fancy sub-product backend later.

P.S. There is no - and will be no - upgrade path from any previous/current
version, until there's a downloadable dev release.
1 <?php // $Id: order.install,v 1.4 2009/07/30 23:14:36 vauxia Exp $
2
3 /**
4 * Implementation of hook_schema().
5 */
6 function order_schema() {
7
8 $schema['order_cart'] = array(
9 'description' => t('TODO: please describe this table!'),
10 'fields' => array(
11 'cid' => array(
12 'description' => t('TODO: please describe this field!'),
13 'type' => 'int',
14 'unsigned' => TRUE,
15 'not null' => TRUE,
16 'default' => 0,
17 ),
18 'uid' => array(
19 'description' => t('TODO: please describe this field!'),
20 'type' => 'int',
21 'unsigned' => TRUE,
22 'not null' => TRUE,
23 'default' => 0,
24 ),
25 'sid' => array(
26 'description' => t('TODO: please describe this field!'),
27 'type' => 'varchar',
28 'length' => '32',
29 'not null' => FALSE,
30 ),
31 'title' => array(
32 'description' => t('TODO: please describe this field!'),
33 'type' => 'varchar',
34 'length' => '200',
35 'not null' => FALSE,
36 ),
37 'data' => array(
38 'description' => t('TODO: please describe this field!'),
39 'type' => 'text',
40 'not null' => FALSE,
41 ),
42 'stamp' => array(
43 'description' => t('TODO: please describe this field!'),
44 'type' => 'int',
45 'not null' => FALSE,
46 ),
47 ),
48 );
49
50 $schema['order_cart_item'] = array(
51 'description' => t('TODO: please describe this table!'),
52 'fields' => array(
53 'cid' => array(
54 'description' => t('TODO: please describe this field!'),
55 'type' => 'int',
56 'unsigned' => TRUE,
57 'not null' => TRUE,
58 'default' => 0,
59 ),
60 'opid' => array(
61 'description' => t('TODO: please describe this field!'),
62 'type' => 'int',
63 'unsigned' => TRUE,
64 'not null' => TRUE,
65 'default' => 0,
66 ),
67 'name' => array(
68 'description' => t('TODO: please describe this field!'),
69 'type' => 'varchar',
70 'length' => '200',
71 'not null' => FALSE,
72 ),
73 'qty' => array(
74 'description' => t('TODO: please describe this field!'),
75 'type' => 'int',
76 'not null' => FALSE,
77 'default' => 1,
78 ),
79 'cost' => array(
80 'description' => t('TODO: please describe this field!'),
81 'type' => 'numeric',
82 'not null' => FALSE,
83 'precision' => '10',
84 'scale' => '2',
85 ),
86 'stamp' => array(
87 'description' => t('TODO: please describe this field!'),
88 'type' => 'int',
89 'not null' => FALSE,
90 ),
91 ),
92 );
93
94 $schema['order_transaction_item'] = array(
95 'description' => t('TODO: please describe this table!'),
96 'fields' => array(
97 'pxid' => array(
98 'description' => t('TODO: please describe this field!'),
99 'type' => 'int',
100 'unsigned' => TRUE,
101 'not null' => TRUE,
102 'default' => 0,
103 ),
104 'type' => array(
105 'description' => t('TODO: please describe this field!'),
106 'type' => 'varchar',
107 'length' => '100',
108 'not null' => FALSE,
109 ),
110 'vid' => array(
111 'description' => t('TODO: please describe this field!'),
112 'type' => 'int',
113 'unsigned' => TRUE,
114 'not null' => FALSE,
115 ),
116 'title' => array(
117 'description' => t('TODO: please describe this field!'),
118 'type' => 'varchar',
119 'length' => '200',
120 'not null' => FALSE,
121 ),
122 'description' => array(
123 'description' => t('TODO: please describe this field!'),
124 'type' => 'text',
125 'not null' => FALSE,
126 ),
127 'cost' => array(
128 'description' => t('TODO: please describe this field!'),
129 'type' => 'numeric',
130 'not null' => TRUE,
131 'default' => 0,
132 'precision' => '10',
133 'scale' => '2',
134 ),
135 'qty' => array(
136 'description' => t('TODO: please describe this field!'),
137 'type' => 'int',
138 'not null' => FALSE,
139 ),
140 ),
141 );
142
143 $schema['order_transaction_cost'] = array(
144 'description' => t('TODO: please describe this table!'),
145 'fields' => array(
146 'pxid' => array(
147 'description' => t('TODO: please describe this field!'),
148 'type' => 'int',
149 'unsigned' => TRUE,
150 'not null' => TRUE,
151 'default' => 0,
152 ),
153 'name' => array(
154 'description' => t('TODO: please describe this field!'),
155 'type' => 'varchar',
156 'length' => '100',
157 'not null' => TRUE,
158 ),
159 'cost' => array(
160 'description' => t('TODO: please describe this field!'),
161 'type' => 'numeric',
162 'not null' => TRUE,
163 'default' => 0,
164 'precision' => '10',
165 'scale' => '2',
166 ),
167 ),
168 );
169
170 $schema['order_transaction_address'] = array(
171 'description' => t('TODO: please describe this table!'),
172 'fields' => array(
173 'pxid' => array(
174 'description' => t('TODO: please describe this field!'),
175 'type' => 'int',
176 'unsigned' => TRUE,
177 'not null' => TRUE,
178 'default' => 0,
179 ),
180 'type' => array(
181 'description' => t('TODO: please describe this field!'),
182 'type' => 'varchar',
183 'length' => '100',
184 'not null' => FALSE,
185 ),
186 'name' => array(
187 'description' => t('TODO: please describe this field!'),
188 'type' => 'varchar',
189 'length' => '100',
190 'not null' => FALSE,
191 ),
192 'first_name' => array(
193 'description' => t('TODO: please describe this field!'),
194 'type' => 'varchar',
195 'length' => '100',
196 'not null' => FALSE,
197 ),
198 'last_name' => array(
199 'description' => t('TODO: please describe this field!'),
200 'type' => 'varchar',
201 'length' => '100',
202 'not null' => FALSE,
203 ),
204 'street1' => array(
205 'description' => t('TODO: please describe this field!'),
206 'type' => 'varchar',
207 'length' => '64',
208 'not null' => FALSE,
209 ),
210 'street2' => array(
211 'description' => t('TODO: please describe this field!'),
212 'type' => 'varchar',
213 'length' => '64',
214 'not null' => FALSE,
215 ),
216 'zip' => array(
217 'description' => t('TODO: please describe this field!'),
218 'type' => 'varchar',
219 'length' => '10',
220 'not null' => FALSE,
221 ),
222 'city' => array(
223 'description' => t('TODO: please describe this field!'),
224 'type' => 'varchar',
225 'length' => '32',
226 'not null' => FALSE,
227 ),
228 'state' => array(
229 'description' => t('TODO: please describe this field!'),
230 'type' => 'varchar',
231 'length' => '32',
232 'not null' => FALSE,
233 ),
234 'country' => array(
235 'description' => t('TODO: please describe this field!'),
236 'type' => 'varchar',
237 'length' => '2',
238 'not null' => FALSE,
239 ),
240 ),
241 );
242
243 $schema['order_rules'] = array(
244 'description' => t('TODO: please describe this table!'),
245 'fields' => array(
246 'hook' => array(
247 'description' => t('TODO: please describe this field!'),
248 'type' => 'varchar',
249 'length' => '100',
250 'not null' => FALSE,
251 ),
252 'weight' => array(
253 'description' => t('TODO: please describe this field!'),
254 'type' => 'int',
255 'not null' => FALSE,
256 ),
257 'callback' => array(
258 'description' => t('TODO: please describe this field!'),
259 'type' => 'varchar',
260 'length' => '200',
261 'not null' => FALSE,
262 ),
263 'arguments' => array(
264 'description' => t('TODO: please describe this field!'),
265 'type' => 'text',
266 'not null' => FALSE,
267 ),
268 ),
269 );
270
271 $schema['order_product'] = array(
272 'description' => t('TODO: please describe this table!'),
273 'fields' => array(
274 'opid' => array(
275 'type' => 'serial',
276 'unsigned' => TRUE,
277 ),
278 'status' => array(
279 'type' => 'int',
280 'size' => 'tiny',
281 'not null' => TRUE,
282 'defalt' => 1,
283 ),
284 'handler' => array(
285 'description' => t('TODO: please describe this field!'),
286 'type' => 'varchar',
287 'length' => '30',
288 'not null' => FALSE,
289 ),
290 'nid' => array(
291 'description' => t('TODO: please describe this field!'),
292 'type' => 'int',
293 'unsigned' => TRUE,
294 'not null' => TRUE,
295 'default' => 0,
296 ),
297 'weight' => array(
298 'type' => 'int',
299 'not null' => TRUE,
300 'default' => 0,
301 ),
302 'cost' => array(
303 'description' => t('TODO: please describe this field!'),
304 'type' => 'numeric',
305 'not null' => FALSE,
306 'precision' => '10',
307 'scale' => '2',
308 ),
309 'qty' => array(
310 'description' => t('TODO: please describe this field!'),
311 'type' => 'numeric',
312 'not null' => FALSE,
313 'precision' => '10',
314 'scale' => '2',
315 ),
316 'title' => array(
317 'description' => t('TODO: please describe this field!'),
318 'type' => 'varchar',
319 'length' => 255,
320 ),
321 'description' => array(
322 'description' => t('TODO: please describe this field!'),
323 'type' => 'text',
324 'not null' => FALSE,
325 ),
326 'description_format' => array(
327 'type' => 'int',
328 'size' => 'tiny',
329 ),
330 'data' => array(
331 'description' => t('TODO: please describe this field!'),
332 'type' => 'text',
333 'serialize' => TRUE,
334 ),
335 ),
336 'primary key' => array('opid'),
337 );
338
339 return $schema;
340 }
341
342 /**
343 * Implementation of hook_install().
344 */
345 function order_install() {
346 drupal_install_schema('order');
347 }
348
349 /**
350 * Implementation of hook_uninstall().
351 */
352 function order_uninstall() {
353 drupal_uninstall_schema('order');
354 }

  ViewVC Help
Powered by ViewVC 1.1.2