   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
-CREATE TABLE `#__cart_cart_items` (
-  `crtId` int(16) NOT NULL,
-  `sId` int(16) NOT NULL,
-  `crtiQty` int(5) DEFAULT NULL,
-  `crtiOldQty` int(5) DEFAULT NULL,
-  `crtiPrice` decimal(10,2) DEFAULT NULL,
-  `crtiOldPrice` decimal(10,2) DEFAULT NULL,
-  `crtiName` varchar(255) DEFAULT NULL,
-  `crtiAvailable` tinyint(1) DEFAULT '1',
-  PRIMARY KEY (`crtId`,`sId`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-		
-CREATE TABLE `#__cart_carts` (
-  `crtId` int(16) NOT NULL AUTO_INCREMENT,
-  `crtCreated` datetime DEFAULT NULL,
-  `crtLastUpdated` datetime DEFAULT NULL,
-  `uidNumber` int(16) DEFAULT NULL,
-  PRIMARY KEY (`crtId`),
-  UNIQUE KEY `uidx_uidNumber` (`uidNumber`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE `#__cart_coupons` (
-  `crtId` int(16) NOT NULL,
-  `cnId` int(16) NOT NULL,
-  `crtCnAdded` datetime DEFAULT NULL,
-  `crtCnStatus` char(15) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-		
-CREATE TABLE `#__cart_memberships` (
-  `crtmId` int(16) NOT NULL AUTO_INCREMENT,
-  `pId` int(16) DEFAULT NULL,
-  `crtId` int(16) DEFAULT NULL,
-  `crtmExpires` datetime DEFAULT NULL,
-  PRIMARY KEY (`crtmId`),
-  UNIQUE KEY `uidx_pId_crtId` (`pId`,`crtId`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE `#__cart_saved_addresses` (
-  `saId` int(16) NOT NULL AUTO_INCREMENT,
-  `uidNumber` int(16) NOT NULL,
-  `saToFirst` char(100) NOT NULL,
-  `saToLast` char(100) NOT NULL,
-  `saAddress` char(255) NOT NULL,
-  `saCity` char(25) NOT NULL,
-  `saState` char(2) NOT NULL,
-  `saZip` char(10) NOT NULL,
-  PRIMARY KEY (`saId`),
-  UNIQUE KEY `uidx_uidNumber_saToFirst_saToLast_saAddress_saZip` (`uidNumber`,`saToFirst`,`saToLast`,`saAddress`(100),`saZip`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE `#__cart_transaction_info` (
-  `tId` int(16) NOT NULL,
-  `tiShippingToFirst` char(100) DEFAULT NULL,
-  `tiShippingToLast` char(100) DEFAULT NULL,
-  `tiShippingAddress` char(255) DEFAULT NULL,
-  `tiShippingCity` char(25) DEFAULT NULL,
-  `tiShippingState` char(2) DEFAULT NULL,
-  `tiShippingZip` char(10) DEFAULT NULL,
-  `tiTotal` decimal(10,2) DEFAULT NULL,
-  `tiSubtotal` decimal(10,2) DEFAULT NULL,
-  `tiTax` decimal(10,2) DEFAULT NULL,
-  `tiShipping` decimal(10,2) DEFAULT NULL,
-  `tiShippingDiscount` decimal(10,2) DEFAULT NULL,
-  `tiDiscounts` decimal(10,2) DEFAULT NULL,
-  `tiItems` text,
-  `tiPerks` text,
-  `tiMeta` text,
-  `tiCustomerStatus` char(15) DEFAULT 'unconfirmed',
-  PRIMARY KEY (`tId`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-		
-CREATE TABLE `#__cart_transaction_items` (
-  `tId` int(16) NOT NULL,
-  `sId` int(16) NOT NULL,
-  `tiQty` int(5) DEFAULT NULL,
-  `tiPrice` decimal(10,2) DEFAULT NULL,
-  PRIMARY KEY (`tId`,`sId`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-		
-CREATE TABLE `#__cart_transaction_steps` (
-  `tsId` int(16) NOT NULL AUTO_INCREMENT,
-  `tId` int(16) NOT NULL,
-  `tsStep` char(16) NOT NULL,
-  `tsStatus` tinyint(1) DEFAULT '0',
-  PRIMARY KEY (`tsId`),
-  UNIQUE KEY `uidx_tId_tsStep` (`tId`,`tsStep`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-		
-CREATE TABLE `#__cart_transactions` (
-  `tId` int(16) NOT NULL AUTO_INCREMENT,
-  `crtId` int(16) DEFAULT NULL,
-  `tCreated` datetime DEFAULT NULL,
-  `tLastUpdated` datetime DEFAULT NULL,
-  `tStatus` char(32) DEFAULT NULL,
-  PRIMARY KEY (`tId`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE `#__cart_cart_items` (
+  `crtId` int(16) NOT NULL,
+  `sId` int(16) NOT NULL,
+  `crtiQty` int(5) DEFAULT NULL,
+  `crtiOldQty` int(5) DEFAULT NULL,
+  `crtiPrice` decimal(10,2) DEFAULT NULL,
+  `crtiOldPrice` decimal(10,2) DEFAULT NULL,
+  `crtiName` varchar(255) DEFAULT NULL,
+  `crtiAvailable` tinyint(1) DEFAULT '1',
+  PRIMARY KEY (`crtId`,`sId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		
+CREATE TABLE `#__cart_carts` (
+  `crtId` int(16) NOT NULL AUTO_INCREMENT,
+  `crtCreated` datetime DEFAULT NULL,
+  `crtLastUpdated` datetime DEFAULT NULL,
+  `uidNumber` int(16) DEFAULT NULL,
+  PRIMARY KEY (`crtId`),
+  UNIQUE KEY `uidx_uidNumber` (`uidNumber`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `#__cart_coupons` (
+  `crtId` int(16) NOT NULL,
+  `cnId` int(16) NOT NULL,
+  `crtCnAdded` datetime DEFAULT NULL,
+  `crtCnStatus` char(15) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		
+CREATE TABLE `#__cart_memberships` (
+  `crtmId` int(16) NOT NULL AUTO_INCREMENT,
+  `pId` int(16) DEFAULT NULL,
+  `crtId` int(16) DEFAULT NULL,
+  `crtmExpires` datetime DEFAULT NULL,
+  PRIMARY KEY (`crtmId`),
+  UNIQUE KEY `uidx_pId_crtId` (`pId`,`crtId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `#__cart_saved_addresses` (
+  `saId` int(16) NOT NULL AUTO_INCREMENT,
+  `uidNumber` int(16) NOT NULL,
+  `saToFirst` char(100) NOT NULL,
+  `saToLast` char(100) NOT NULL,
+  `saAddress` char(255) NOT NULL,
+  `saCity` char(25) NOT NULL,
+  `saState` char(2) NOT NULL,
+  `saZip` char(10) NOT NULL,
+  PRIMARY KEY (`saId`),
+  UNIQUE KEY `uidx_uidNumber_saToFirst_saToLast_saAddress_saZip` (`uidNumber`,`saToFirst`,`saToLast`,`saAddress`(100),`saZip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `#__cart_transaction_info` (
+  `tId` int(16) NOT NULL,
+  `tiShippingToFirst` char(100) DEFAULT NULL,
+  `tiShippingToLast` char(100) DEFAULT NULL,
+  `tiShippingAddress` char(255) DEFAULT NULL,
+  `tiShippingCity` char(25) DEFAULT NULL,
+  `tiShippingState` char(2) DEFAULT NULL,
+  `tiShippingZip` char(10) DEFAULT NULL,
+  `tiTotal` decimal(10,2) DEFAULT NULL,
+  `tiSubtotal` decimal(10,2) DEFAULT NULL,
+  `tiTax` decimal(10,2) DEFAULT NULL,
+  `tiShipping` decimal(10,2) DEFAULT NULL,
+  `tiShippingDiscount` decimal(10,2) DEFAULT NULL,
+  `tiDiscounts` decimal(10,2) DEFAULT NULL,
+  `tiItems` text,
+  `tiPerks` text,
+  `tiMeta` text,
+  `tiCustomerStatus` char(15) DEFAULT 'unconfirmed',
+  PRIMARY KEY (`tId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		
+CREATE TABLE `#__cart_transaction_items` (
+  `tId` int(16) NOT NULL,
+  `sId` int(16) NOT NULL,
+  `tiQty` int(5) DEFAULT NULL,
+  `tiPrice` decimal(10,2) DEFAULT NULL,
+  PRIMARY KEY (`tId`,`sId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		
+CREATE TABLE `#__cart_transaction_steps` (
+  `tsId` int(16) NOT NULL AUTO_INCREMENT,
+  `tId` int(16) NOT NULL,
+  `tsStep` char(16) NOT NULL,
+  `tsStatus` tinyint(1) DEFAULT '0',
+  PRIMARY KEY (`tsId`),
+  UNIQUE KEY `uidx_tId_tsStep` (`tId`,`tsStep`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+		
+CREATE TABLE `#__cart_transactions` (
+  `tId` int(16) NOT NULL AUTO_INCREMENT,
+  `crtId` int(16) DEFAULT NULL,
+  `tCreated` datetime DEFAULT NULL,
+  `tLastUpdated` datetime DEFAULT NULL,
+  `tStatus` char(32) DEFAULT NULL,
+  PRIMARY KEY (`tId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 CREATE TABLE `#__citations` (
   `id` int(11) NOT NULL AUTO_INCREMENT,

  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_collections` (
  `cId` char(50) NOT NULL,
  `cName` varchar(64) DEFAULT NULL,
  `cParent` int(16) DEFAULT NULL,
  `cActive` tinyint(1) DEFAULT NULL,
  `cType` char(10) DEFAULT NULL,
  PRIMARY KEY (`cId`),
  KEY `idx_cActive` (`cActive`),
  KEY `idx_cParent` (`cParent`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_coupon_actions` (
  `cnId` int(16) NOT NULL,
  `cnaAction` char(25) DEFAULT NULL,
  `cnaVal` char(255) DEFAULT NULL,
  UNIQUE KEY `uidx_cnId_cnaAction` (`cnId`,`cnaAction`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
		
CREATE TABLE `#__storefront_coupon_conditions` (
  `cnId` int(16) NOT NULL,
  `cncRule` char(100) DEFAULT NULL,
  `cncVal` char(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_coupon_objects` (
  `cnId` int(16) NOT NULL,
  `cnoObjectId` int(16) DEFAULT NULL,
  `cnoObjectsLimit` int(5) DEFAULT '0' COMMENT 'How many objects can be applied to. 0 - unlimited',
  UNIQUE KEY `uidx_cnId_cnoObjectId` (`cnId`,`cnoObjectId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_coupons` (
  `cnId` int(16) NOT NULL AUTO_INCREMENT,
  `cnCode` char(25) DEFAULT NULL,
  `cnDescription` char(255) DEFAULT NULL,
  `cnExpires` date DEFAULT NULL,
  `cnUseLimit` int(5) unsigned DEFAULT NULL,
  `cnObject` char(15) NOT NULL,
  `cnActive` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`cnId`),
  UNIQUE KEY `uidx_cnCode` (`cnCode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_option_groups` (
  `ogId` int(16) NOT NULL AUTO_INCREMENT,
  `ogName` char(16) DEFAULT NULL,
  PRIMARY KEY (`ogId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
		
CREATE TABLE `#__storefront_options` (
  `oId` int(16) NOT NULL AUTO_INCREMENT,
  `ogId` int(16) DEFAULT NULL COMMENT 'Foreign key to option-groups',
  `oName` char(255) DEFAULT NULL,
  PRIMARY KEY (`oId`),
  UNIQUE KEY `uidx_ogId_oName` (`ogId`,`oName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_product_collections` (
  `cllId` int(16) NOT NULL AUTO_INCREMENT,
  `pId` int(16) NOT NULL,
  `cId` char(50) NOT NULL,
  PRIMARY KEY (`cllId`,`pId`,`cId`),
  UNIQUE KEY `uidx_pId_cId` (`pId`,`cId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
		
CREATE TABLE `#__storefront_product_option_groups` (
  `pId` int(16) NOT NULL,
  `ogId` int(16) NOT NULL,
  PRIMARY KEY (`pId`,`ogId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
	
CREATE TABLE `#__storefront_product_types` (
  `ptId` int(16) NOT NULL AUTO_INCREMENT,
  `ptName` char(128) DEFAULT NULL,
  `ptModel` char(25) DEFAULT 'normal',
  PRIMARY KEY (`ptId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_products` (
  `pId` int(16) NOT NULL AUTO_INCREMENT,
  `ptId` int(16) NOT NULL COMMENT 'Product type ID. Foreign key to product_types table',
  `pName` char(128) DEFAULT NULL,
  `pTagline` tinytext,
  `pDescription` text,
  `pFeatures` text,
  `pActive` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`pId`),
  KEY `idx_pActive` (`pActive`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_sku_meta` (
  `smId` int(16) NOT NULL AUTO_INCREMENT,
  `sId` int(16) NOT NULL,
  `smKey` varchar(100) DEFAULT NULL,
  `smValue` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`smId`),
  UNIQUE KEY `uidx_sId_smKey` (`sId`,`smKey`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

$query = "CREATE TABLE `#__storefront_sku_options` (
  `sId` int(16) NOT NULL,
  `oId` int(16) NOT NULL,
  PRIMARY KEY (`sId`,`oId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__storefront_skus` (
  `sId` int(16) NOT NULL AUTO_INCREMENT,
  `pId` int(16) DEFAULT NULL COMMENT 'Foreign key to products',
  `sSku` char(16) DEFAULT NULL,
  `sWeight` decimal(10,2) DEFAULT NULL,
  `sPrice` decimal(10,2) DEFAULT NULL,
  `sDescriprtion` text,
  `sFeatures` text,
  `sTrackInventory` tinyint(1) DEFAULT '0',
  `sInventory` int(11) DEFAULT '0',
  `sEnumerable` tinyint(1) DEFAULT '1',
  `sAllowMultiple` tinyint(1) DEFAULT '1',
  `sActive` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`sId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `#__support_acl_acos` (

  `active` smallint(2) NOT NULL DEFAULT '1',
  UNIQUE KEY `uidx_jobid` (`jobid`),
  KEY `idx_start` (`start`),
  KEY `idx_heartbeat` (`heartbeat`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `joblog` (
