From CEDPS
Introduction
This schema uses what is called an Entity Attribute Value (EAV) design. Mostly scoffed at by database
professionals, this design does have its proponents from the world of clinical trials. Wikipedia has a nice
page on it, too.
The "main" table, which makes this an EAV schema, is the attr table. The 'e_id' is the entity, 'name' is the attribute, and 'value' is the value (duh).
Current schema
| Text
| Picture
|
--
-- Table structure for table `attr`
--
DROP TABLE IF EXISTS `attr`;
CREATE TABLE `attr` (
`e_id` int(11) default NULL,
`name` varchar(255) default NULL,
`value` varchar(255) default NULL,
KEY `e_id` (`e_id`),
KEY `name` USING HASH (`name`(20)),
KEY `value` (`value`(20))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `dn`
--
DROP TABLE IF EXISTS `dn`;
CREATE TABLE `dn` (
`e_id` int(11) default NULL,
`value` varchar(255) default NULL,
KEY `e_id` (`e_id`),
KEY `value` (`value`(20))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `event`
--
DROP TABLE IF EXISTS `event`;
CREATE TABLE `event` (
`id` int(11) NOT NULL,
`time` double NOT NULL,
`name` varchar(255) default NULL,
`startend` tinyint(2) unsigned default NULL,
`severity` tinyint(8) unsigned default NULL,
PRIMARY KEY (`id`),
KEY `time` (`time`),
KEY `name` USING HASH (`name`(20))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `ident`
--
DROP TABLE IF EXISTS `ident`;
CREATE TABLE `ident` (
`e_id` int(11) default NULL,
`name` varchar(255) default NULL,
`value` varchar(255) default NULL,
KEY `e_id` (`e_id`),
KEY `name` USING HASH (`name`(20)),
KEY `value` (`value`(20))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `text`
--
DROP TABLE IF EXISTS `text`;
CREATE TABLE `text` (
`e_id` int(11) default NULL,
`value` mediumtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
|