entities

This is the master table for all entity types. All entities must have a unique entity_id stored in this table. All entity_* tables reference this table's ID numbers as foreign keys. Deleting an entity from this table cascades a delete from other entity_* tables as well.

Pellucid 2.0 stores every single kind of entity data in this table (hospital, asc, calculation, geography, nursing_home, etc), as opposed to separate tables for each in the original Pellucid schema.

Table Creation

CREATE TABLE entities ( 
`entity_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
`type` varchar(255) DEFAULT NULL, 
`created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', 
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, 
PRIMARY KEY (`entity_id`) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

 

Fields

fieldtypeattributesnotesexample
entities.entity_idbigint(20)UNSIGNED NOT NULL AUTO_INCREMENTProvided by Pellucid12345678901234567890
entities.typevarchar(255)DEFAULT NULLThe type of hospital, found in hospital data'hospital'
entities.createdtimestampNOT NULL DEFAULT '0000-00-00 00:00:00'The date and time the row was created'2010-05-18 09:15:36'
entities.modifiedtimestampNOT NULL DEFAULT '0000-00-00 00:00:00'The date and time the row was last updated. Can be set to current using UPDATE CURRENT_TIMESTAMP'2010-05-18 09:15:36'


PRIMARY KEY (`entity_id`) 
Links to 
entity_hospitalsentity_ascsentity_geographiesentity_values, and entity_calculations