| 1 |
<?php
|
| 2 |
// $Id: uc_node_checkout.install,v 1.2.2.1 2009/01/20 22:28:17 rszrama Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function uc_node_checkout_install() {
|
| 8 |
// Create tables.
|
| 9 |
drupal_install_schema('uc_node_checkout');
|
| 10 |
}
|
| 11 |
/**
|
| 12 |
* Implementation of hook_uninstall().
|
| 13 |
*/
|
| 14 |
function uc_node_checkout_uninstall() {
|
| 15 |
// Remove tables.
|
| 16 |
drupal_uninstall_schema('uc_node_checkout');
|
| 17 |
}
|
| 18 |
|
| 19 |
/**
|
| 20 |
* Implementation of hook_schema().
|
| 21 |
*/
|
| 22 |
function uc_node_checkout_schema() {
|
| 23 |
$schema['uc_node_checkout_types'] = array(
|
| 24 |
'fields' => array(
|
| 25 |
'type' => array(
|
| 26 |
'type' => 'varchar',
|
| 27 |
'length' => 255,
|
| 28 |
'not null' => TRUE,
|
| 29 |
'default' => '',
|
| 30 |
),
|
| 31 |
'product_nid' => array(
|
| 32 |
'type' => 'int',
|
| 33 |
'not null' => TRUE,
|
| 34 |
'default' => 0,
|
| 35 |
),
|
| 36 |
'node_view' => array(
|
| 37 |
'type' => 'varchar',
|
| 38 |
'length' => 255,
|
| 39 |
'not null' => TRUE,
|
| 40 |
'default' => '',
|
| 41 |
),
|
| 42 |
),
|
| 43 |
'indexes' => array(
|
| 44 |
'type' => array('type'),
|
| 45 |
),
|
| 46 |
);
|
| 47 |
|
| 48 |
$schema['uc_node_checkout_order_products'] = array(
|
| 49 |
'fields' => array(
|
| 50 |
'nid' => array(
|
| 51 |
'type' => 'int',
|
| 52 |
'not null' => TRUE,
|
| 53 |
'default' => 0,
|
| 54 |
),
|
| 55 |
'order_product_id' => array(
|
| 56 |
'type' => 'int',
|
| 57 |
'not null' => TRUE,
|
| 58 |
'default' => 0,
|
| 59 |
),
|
| 60 |
),
|
| 61 |
'primary key' => array('nid'),
|
| 62 |
);
|
| 63 |
|
| 64 |
return $schema;
|
| 65 |
}
|
| 66 |
|
| 67 |
/**
|
| 68 |
* Implementation of hook_update_N().
|
| 69 |
*/
|
| 70 |
function uc_node_checkout_update_6100() {
|
| 71 |
$ret = array();
|
| 72 |
|
| 73 |
// Change the type column to a varchar(255).
|
| 74 |
// Add the node_view column.
|
| 75 |
|
| 76 |
// Add the second table.
|
| 77 |
|
| 78 |
return $ret;
|
| 79 |
}
|