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

Contents of /contributions/modules/uc_po/uc_po.install

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


Revision 1.2 - (show annotations) (download) (as text)
Fri Apr 24 00:59:42 2009 UTC (7 months ago) by rszrama
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1, DRUPAL-6--2
Changes since 1.1: +58 -31 lines
File MIME type: text/x-php
Update to D6.
1 <?php
2 // $Id: uc_po.install,v 1.1 2008/05/07 19:35:39 rszrama Exp $
3
4 /**
5 * @file
6 *
7 * Provide functions to install and uninstall the purchase
8 * order module in the database
9 */
10
11
12 /**
13 * Implementation of hook_schema().
14 */
15 function uc_po_schema() {
16 $schema['uc_payment_po'] = array(
17 'fields' => array(
18 'po_id' => array(
19 'type' => 'serial',
20 'unsigned' => TRUE,
21 'not null' => TRUE,
22 ),
23 'order_id' => array(
24 'type' => 'int',
25 'unsigned' => TRUE,
26 'not null' => TRUE,
27 'default' => 0,
28 ),
29 'po_number' => array(
30 'type' => 'varchar',
31 'length' => '255',
32 'not null' => TRUE,
33 'default' => '',
34 ),
35 ),
36 'primary key' => array('po_id'),
37 'indexes' => array(
38 'order_id' => array('order_id')),
39 );
40
41 return $schema;
42 }
43
44 /**
45 * Implementation of hook_install().
46 */
47 function uc_po_install() {
48 drupal_install_schema('uc_po');
49 }
50
51 /**
52 * Implementation of hook_uninstall().
53 */
54 function uc_po_uninstall() {
55 drupal_uninstall_schema('uc_po');
56
57 variable_del('uc_po_instructions');
58 variable_del('uc_po_roles');
59 }
60
61 /**
62 * Implementations of hook_update_N().
63 */
64 function uc_po_update_6000() {
65 $ret = array();
66
67 db_drop_primary_key($ret, 'uc_payment_po');
68 db_change_field($ret, 'uc_payment_po', 'po_id', 'po_id', array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), array('primary key' => array('po_id')));
69
70 return $ret;
71 }
72

  ViewVC Help
Powered by ViewVC 1.1.2