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

Diff of /contributions/modules/uc_turkish_banks/uc_turkish_banks.install

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

revision 1.3, Sun Jun 22 18:46:51 2008 UTC revision 1.3.2.1, Sun Mar 29 15:37:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: uc_turkish_banks.install,v 1.2 2008/06/22 15:14:19 bakyildiz Exp $  // $Id: uc_turkish_banks.install,v 1.3 2008/06/22 18:46:51 bakyildiz Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
6   */   */
7  function uc_turkish_banks_install() {  function uc_turkish_banks_install() {
8    switch ($GLOBALS['db_type']) {    drupal_install_schema('uc_turkish_banks');
9      case 'mysql':  }
10      case 'mysqli':  
11        db_query("CREATE TABLE {uc_turkish_banks} (  function uc_turkish_banks_schema() {
12          cid int(10) unsigned NOT NULL AUTO_INCREMENT,    $schema = array();
         bankname varchar(45) NOT NULL,  
         valid_until int(11) unsigned NOT NULL,  
         clientid varchar(10) NOT NULL,  
         username varchar(20) NOT NULL,  
         password varchar(20) NOT NULL,  
         storekey varchar(20) NOT NULL,  
         cardname varchar(100) NOT NULL,  
         processtype varchar(10) NOT NULL,  
         bankurl varchar(100) NOT NULL,  
         PRIMARY KEY (cid, bankname)  
       ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");  
13    
14        db_query("CREATE TABLE {uc_turkish_banks_orders} (    $schema['uc_turkish_banks'] = array(
15          cuid int(11) NOT NULL auto_increment,      'fields' => array(
16          cid int(11) NOT NULL,        'cid' => array(
17          oid int(11) NOT NULL default '0',          'type' => 'int',
18          PRIMARY KEY (cuid)          'auto_increment' => TRUE,
19        ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");          'length' => 10,
20            'unsigned' => TRUE,
21        db_query("CREATE TABLE {uc_turkish_banks_instalments} (          'not null' => TRUE,
22          cid int(10) UNSIGNED NOT NULL,        ),
23          instalment VARCHAR(45) NOT NULL,        'bankname' => array(
24          instalment_ratio decimal(4,2) NOT NULL,          'type' => 'varchar',
25          valid_until INTEGER NOT NULL          'length' => 45,
26        ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");          'not null' => TRUE,
27        break;        ),
28    }        'valid_until' => array(
29            'type' => 'int',
30            'length' => 10,
31            'unsigned' => TRUE,
32            'not null' => TRUE,
33          ),
34          'clientid' => array(
35            'type' => 'varchar',
36            'length' => 10,
37            'not null' => TRUE,
38          ),
39          'username' => array(
40            'type' => 'varchar',
41            'length' => 20,
42            'not null' => TRUE,
43          ),
44          'password' => array(
45            'type' => 'varchar',
46            'length' => 20,
47            'not null' => TRUE,
48          ),
49          'storekey' => array(
50            'type' => 'varchar',
51            'length' => 20,
52            'not null' => TRUE,
53          ),
54          'cardname' => array(
55            'type' => 'varchar',
56            'length' => 100,
57            'not null' => TRUE,
58          ),
59          'processtype' => array(
60            'type' => 'varchar',
61            'length' => 10,
62            'not null' => TRUE,
63          ),
64          'bankurl' => array(
65            'type' => 'varchar',
66            'length' => 100,
67            'not null' => TRUE,
68          )
69        ),
70        'primary key' => array('cid','bankname'),
71      );
72    
73      $schema['uc_turkish_banks_orders'] = array(
74        'fields' => array(
75          'coid' => array(
76            'type' => 'int',
77            'auto_increment' => TRUE,
78            'length' => 11,
79            'unsigned' => TRUE,
80            'not null' => TRUE,
81          ),
82          'cid' => array(
83            'type' => 'int',
84            'length' => 11,
85            'unsigned' => TRUE,
86            'not null' => TRUE,
87          ),
88          'oid' => array(
89            'type' => 'int',
90            'length' => 11,
91            'unsigned' => TRUE,
92            'not null' => TRUE,
93            'default' => 0,
94          )
95        ),
96        'primary key' => array('coid'),
97      );
98    
99       $schema['uc_turkish_banks_instalments'] = array(
100        'fields' => array(
101          'cid' => array(
102            'type' => 'int',
103            'length' => 11,
104            'unsigned' => TRUE,
105            'not null' => TRUE,
106          ),
107          'instalment' => array(
108            'type' => 'varchar',
109            'length' => 45,
110            'not null' => TRUE,
111          ),
112          'instalment_ratio' => array(
113            'type' => 'numeric',
114            'precision' => 4,
115            'scale' => 2,
116            'not null' => TRUE,
117          ),
118          'valid_until' => array(
119            'type' => 'int',
120            'length' => 10,
121            'unsigned' => TRUE,
122            'not null' => TRUE,
123          )
124        ),
125      );
126      return $schema;
127  }  }
128    
129    
130  /**  /**
131   * Implementation of hook_uninstall().   * Implementation of hook_uninstall().
132   */   */
133  function uc_turkish_banks_uninstall() {  function uc_turkish_banks_uninstall() {
134    db_query("DROP TABLE {uc_turkish_banks}");    drupal_uninstall_schema('uc_turkish_banks');
   db_query("DROP TABLE {uc_turkish_banks_orders}");  
   db_query("DROP TABLE {uc_turkish_banks_instalments}");  
135    drupal_set_message(t("uc_turkish_banks successfully uninstalled."));    drupal_set_message(t("uc_turkish_banks successfully uninstalled."));
136  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.1

  ViewVC Help
Powered by ViewVC 1.1.2