You are here

function uc_credit_install in Ubercart 5

Implementation of hook_install().

File

payment/uc_credit/uc_credit.install, line 6

Code

function uc_credit_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {uc_payment_credit} (\n        credit_id mediumint(9) NOT NULL auto_increment,\n        order_id mediumint(9) NOT NULL,\n        cc_type varchar(255) NOT NULL,\n        cc_owner varchar(255) NOT NULL,\n        cc_number varchar(255) NOT NULL,\n        cc_exp_month varchar(255) NOT NULL,\n        cc_exp_year varchar(255) NOT NULL,\n        cc_cvv varchar(255) NOT NULL,\n        cc_bank varchar(255) NOT NULL,\n        PRIMARY KEY  (credit_id),\n        KEY order_id (order_id)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {uc_payment_credit} (\n        credit_id serial NOT NULL,\n        order_id integer NOT NULL,\n        cc_type varchar(255) NOT NULL,\n        cc_owner varchar(255) NOT NULL,\n        cc_number varchar(255) NOT NULL,\n        cc_exp_month varchar(255) NOT NULL,\n        cc_exp_year varchar(255) NOT NULL,\n        cc_cvv varchar(255) NOT NULL,\n        cc_bank varchar(255) NOT NULL,\n        PRIMARY KEY (credit_id)\n      );");
      db_query("CREATE INDEX {uc_payment_credit}_order_id ON {uc_payment_credit} (order_id)");
      break;
  }
}