<?php

function hcc_business_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
    	db_query("CREATE TABLE {hcc_business} (
    		nid 				int unsigned NOT NULL default '0',
    		description 		text,
    		keywords			varchar(255),
    		chamber_member		boolean NOT NULL default '0',
    		url					varchar(255),
    		email				varchar(255),
    		contact				varchar(255),
    		address1_line1		varchar(50),
    		address1_line2		varchar(50),
    		address1_city		varchar(50),
    		address1_state		char(2),
    		address1_zip		varchar(10),
    		address1_latitude	float,
    		address1_longitude	float,
    		address1_showmap	boolean NOT NULL default '0',
    		address2_line1		varchar(50),
    		address2_line2		varchar(50),
    		address2_city		varchar(50),
    		address2_state		char(2),
    		address2_zip		varchar(10),
    		address2_latitude	float,
    		address2_longitude	float,
    		address2_showmap	boolean NOT NULL default '0',
    		PRIMARY KEY (nid)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
    	db_query("CREATE TABLE {hcc_review} (
    		nid 		int unsigned NOT NULL default '0',
    		bid			int unsigned NOT NULL default '0',
    		bname		varchar(255),
    		rating		int,
    		PRIMARY KEY (nid)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
   
    case 'pgsql':
    	db_query("CREATE TABLE {hcc_business} (
    		nid 				integer unsigned NOT NULL default '0',
    		description 		text,
    		keywords			varchar(255),
    		chamber_member		boolean NOT NULL default '0',
    		url					varchar(255),
    		email				varchar(255),
    		contact				varchar(255),
    		address1_line1		varchar(50),
    		address1_line2		varchar(50),
    		address1_city		varchar(50),
    		address1_state		char(2),
    		address1_zip		varchar(10),
    		address1_latitude	real,
    		address1_longitude	real,
    		address1_showmap	boolean NOT NULL default '0',
    		address2_line1		varchar(50),
    		address2_line2		varchar(50),
    		address2_city		varchar(50),
    		address2_state		char(2),
    		address2_zip		varchar(10),
    		address2_latitude	real,
    		address2_longitude	real,
    		address2_showmap	boolean NOT NULL default '0',
    		PRIMARY KEY (nid)
        )");
    	db_query("CREATE TABLE {hcc_review} (
    		nid 		integer unsigned NOT NULL default '0',
    		bid			integer unsigned NOT NULL default '0',
    		bname		varchar(255),
    		rating		integer,
    		PRIMARY KEY (nid)
        )");
      break;
  }
}
?>