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

Diff of /contributions/modules/donation/donation.install

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

revision 1.2.2.1, Tue May 26 02:27:37 2009 UTC revision 1.2.2.2, Wed Oct 14 22:49:00 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: donation.install,v 1.2 2009/03/14 21:00:35 kbahey Exp $  // $Id: donation.install,v 1.2.2.1 2009/05/26 02:27:37 kbahey Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 20  function donation_install() { Line 20  function donation_install() {
20  function donation_schema() {  function donation_schema() {
21    $schema['donations'] = array(    $schema['donations'] = array(
22      'fields' => array(      'fields' => array(
23           'did'           => array('type' => 'serial',                     'not null' => TRUE,  'disp-width' => '10'),        'did'           => array('type' => 'serial',                     'not null' => TRUE,  'disp-width' => '10'),
24           'status'        => array('type' => 'int',     'default' => 1,    'not null' => TRUE,  'disp-width' => '2'),        'status'        => array('type' => 'int',     'default' => 1,    'not null' => TRUE,  'disp-width' => '2'),
25           'name'          => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),        'name'          => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
26           'mail'          => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),        'mail'          => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
27           'timestamp'     => array('type' => 'int',     'default' => 0,    'not null' => TRUE,  'disp-width' => '11'),        'timestamp'     => array('type' => 'int',     'default' => 0,    'not null' => TRUE,  'disp-width' => '11'),
28           'amount'        => array('type' => 'float',                      'not null' => FALSE),        'amount'        => array('type' => 'float',                      'not null' => FALSE),
29           'currency'      => array('type' => 'varchar', 'length' => '5',   'not null' => FALSE, 'default' => 'USD'),        'currency'      => array('type' => 'varchar', 'length' => '5',   'not null' => FALSE, 'default' => 'USD'),
30           'uid'           => array('type' => 'int',                        'not null' => FALSE, 'disp-width' => '11'),        'uid'           => array('type' => 'int',                        'not null' => FALSE, 'disp-width' => '11'),
31           'donor_name'    => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),        'donor_name'    => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
32           'donor_url'     => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),        'donor_url'     => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
33           'donor_memo'    => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),        'donor_memo'    => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
34           'paypal_txn_id' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),        'paypal_txn_id' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
35           'donor_comment' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE)),        'donor_comment' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
36          'nid'           => array('type' => 'int'),
37          'fee'           => array('type' => 'float',                      'not null' => FALSE),
38          ),
39      'primary key' => array('did'),      'primary key' => array('did'),
40      'indexes' => array(      'indexes' => array(
41           'donation_mail_idx' => array('mail'),        'donation_mail_idx' => array('mail'),
42           'donation_timestamp_idx' => array('timestamp'),        'donation_timestamp_idx' => array('timestamp'),
43           'donation_uid_idx' => array('uid')),        'donation_uid_idx' => array('uid')),
44    );    );
45    return $schema;    return $schema;
46  }  }
# Line 48  function donation_schema() { Line 51  function donation_schema() {
51  function donation_uninstall() {  function donation_uninstall() {
52    drupal_uninstall_schema('donation');    drupal_uninstall_schema('donation');
53  }  }
54    
55    /**
56    * Implementation of hook_update().
57    */
58    function donation_update_1() {
59      $ret = array();
60      db_add_field($ret, 'donations', 'nid', array('type' => 'int'));
61      db_add_field($ret, 'donations', 'fee', array('type' => 'float', 'not null' => FALSE));
62      return $ret;
63    }

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

  ViewVC Help
Powered by ViewVC 1.1.2