-- first our items table:
CREATE TABLE `items` (
`id` int(11) NOT NULL auto_increment,
`item_name` varchar(50) default NULL,
PRIMARY KEY (`id`)
);
-- now our item attributes
CREATE TABLE `item_attributes` (
`id` int(11) NOT NULL auto_increment,
`item_id` int(11) NOT NULL default '0',
`attribute_name` varchar(50) default NULL,
PRIMARY KEY (`id`),
KEY `item_id_attribute_name` (`item_id`,`attribute_name`)
);
-- now finally our attribute values
CREATE TABLE `attribute_values` (
`attribute_id` int(11) NOT NULL default '0',
`attribute_value` varchar(100) default NULL,
UNIQUE KEY `attribute_id` (`attribute_id`,`attribute_value`)
);
0 comments:
Post a Comment