<?php

function registration_install(){
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE registration (
        nid int(10) unsigned NOT NULL default '0',
  			firstname varchar(32) NOT NULL,
  			lastname varchar(32) NOT NULL,
				email varchar(128) NOT NULL,
				street1 varchar(64) NOT NULL,
				street2 varchar(64) NOT NULL,
				city varchar(32) NOT NULL,
				state varchar(32) NOT NULL,
				zip varchar(10) NOT NULL,
				country varchar(2) NOT NULL,
				company varchar(128) NOT NULL,
				url varchar(128) NOT NULL,
				txnid int(10) unsigned NOT NULL,
				productid int(10) unsigned NOT NULL,
				PRIMARY KEY  (nid),
				KEY nid (nid)
        ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
        
      db_query("CREATE TABLE registration_attendees (
        nid int(10) unsigned NOT NULL,
				rid int(10) unsigned NOT NULL,
				firstname varchar(128) collate latin1_general_ci NOT NULL,
				lastname varchar(128) collate latin1_general_ci NOT NULL,
				email varchar(128) collate latin1_general_ci NOT NULL,
				company varchar(128) collate latin1_general_ci NOT NULL,
				url varchar(128) collate latin1_general_ci NOT NULL,
				display tinyint(4) NOT NULL,
				PRIMARY KEY  (nid)
        ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");

      drupal_set_message(t('registration database tables have been installed.'));
      break;
      
    case 'pgsql':
      break;
  }
}



