#P d5_uc_ideal_easy
Index: uc_ideal_easy_payment.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_ideal_easy/uc_ideal_easy_payment.install,v
retrieving revision 1.1
diff -u -r1.1 uc_ideal_easy_payment.install
--- uc_ideal_easy_payment.install	19 Aug 2008 07:15:36 -0000	1.1
+++ uc_ideal_easy_payment.install	6 Apr 2010 19:36:21 -0000
@@ -1,23 +1,62 @@
 <?php
-// $Id: uc_ideal_easy_payment.install,v 1.1 2008/08/19 07:15:36 keesje76 Exp $
+// $Id$
+
+/**
+ * Implementation of hook_schema().
+ */
+function uc_ideal_easy_payment_schema() {
+  $schema['uc_payment_ideal_easy'] = array(
+    'description' => t('Table for iDEAL payments.'),
+    'fields' => array(
+      'order_id' => array(
+        'description' => t('Ubercart order id'),
+        'type' => 'int',
+        'size' => 'medium',
+        'not null' => TRUE,
+      ),
+      'transaction_id' => array(
+        'description' => t('Transaction id'),
+        'type' => 'int',
+        'size' => 'medium',
+        'not null' => TRUE,
+      ),
+      'description' => array(
+        'description' => t('Description'),
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+      ),
+      'order_status' => array(
+        'description' => t('Order payment status'),
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+      ),
+      'return_succes' => array(
+        'description' => t('Returned succes value'),
+        'type' => 'text',
+        'size' => 'small',
+        'not null' => TRUE,
+      ),
+    ),
+    'primary key' => array('order_id'),
+  );
+
+  return $schema;
+}
 
 /**
  * Implementation of hook_install().
  */
 function uc_ideal_easy_payment_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {uc_payment_ideal_easy} (
-        order_id mediumint(9) NOT NULL,
-        transaction_id mediumint(9) NOT NULL,
-        description varchar(64) NOT NULL,
-        order_status tinyint(4) NOT NULL,
-        return_succes tinytext NOT NULL,
-        PRIMARY KEY  (order_id)
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      break;
-    case 'pgsql':
-      break;
-  }
+  // Create tables.
+  drupal_install_schema('uc_payment_ideal_easy');
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function uc_ideal_easy_payment_uninstall() {
+  // Delete tables.
+  drupal_uninstall_schema('uc_payment_ideal_easy');
 }
