--
-- Table structure for table `products`
--

CREATE TABLE IF NOT EXISTS `products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(24) NOT NULL,
  `type` varchar(24) NOT NULL,
  `brand` varchar(24) NOT NULL,
  `colour` varchar(24) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
  KEY `brand` (`brand`),
  KEY `colour` (`colour`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `type`, `brand`, `colour`) VALUES
(1, 'Black Jacket by Acme', 'jacket', 'Acme Apparel', 'black'),
(2, 'Blue Jacket by Acme', 'jacket', 'Acme Apparel', 'blue'),
(3, 'Blue Jacket by FF', 'jacket', 'Fictive Fashion', 'blue'),
(4, 'Orange Trousers by FF', 'trousers', 'Fictive Fashion', 'orange');

-- --------------------------------------------------------

--
-- Table structure for table `product_facets`
--

CREATE TABLE IF NOT EXISTS `product_facets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(24) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `product_facets`
--

INSERT INTO `product_facets` (`id`, `name`) VALUES
(1, 'type'),
(2, 'brand'),
(3, 'colour');

-- --------------------------------------------------------

--
-- Table structure for table `product_facts`
--

CREATE TABLE IF NOT EXISTS `product_facts` (
  `product_id` int(11) NOT NULL,
  `facet_id` int(11) NOT NULL,
  `facet_name` varchar(24) NOT NULL,
  `value` varchar(24) NOT NULL,
  KEY `product_id` (`product_id`),
  KEY `facet_id` (`facet_id`),
  KEY `facet_name` (`facet_name`),
  KEY `value` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `product_facts`
--

INSERT INTO `product_facts` (`product_id`, `facet_id`, `facet_name`, `value`) VALUES
(1, 1, 'type', 'jacket'),
(1, 2, 'brand', 'Acme Apparel'),
(1, 3, 'colour', 'black'),
(2, 1, 'type', 'jacket'),
(2, 2, 'brand', 'Acme Apparel'),
(2, 3, 'colour', 'blue'),
(3, 1, 'type', 'jacket'),
(3, 2, 'brand', 'Fictive Fashion'),
(3, 3, 'colour', 'blue'),
(4, 1, 'type', 'trousers'),
(4, 2, 'brand', 'Fictive Fashion'),
(4, 3, 'colour', 'orange');


