ALTER TABLE `shop_products` ADD IF NOT EXISTS `shipping_tbd` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `shipping_weight`;
ALTER TABLE `shop_products` ADD IF NOT EXISTS `shipping_na` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `shipping_tbd`;
ALTER TABLE `shop_taxes` ADD INDEX `tax_country` (`tax_country`);
ALTER TABLE `shop_taxes` ADD INDEX `tax_province` (`tax_province`);
ALTER TABLE `shop_products` DROP INDEX `datasource_product_id`;
ALTER TABLE `users` ADD IF NOT EXISTS `restricted_admin` TINYINT(1) NOT NULL DEFAULT 0 AFTER `media_admin`;

CREATE TABLE `shop_postalcodes` (
  `postalcode_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `city` varchar(255) NOT NULL DEFAULT '',
  `province` char(2) NOT NULL DEFAULT '',
  `postalcode` varchar(6) NOT NULL DEFAULT '',
  `country` char(2) NOT NULL DEFAULT '',
  `latitude` varchar(10) NOT NULL DEFAULT '',
  `longitude` varchar(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`postalcode_id`),
  UNIQUE KEY `postalcode` (`postalcode`,`province`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `shop_config` (`site_id`, `config_label`, `config_key`, `config_value`, `input_type`, `sort`) VALUES (1, 'Default Category Layout', 'category_layout_id', '2', 'text', 10);
