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
field | type | attributes | notes | example |
---|---|---|---|---|
entities.entity_id | bigint(20) | UNSIGNED NOT NULL AUTO_INCREMENT | Provided by Pellucid | 12345678901234567890 |
entities.type | varchar(255) | DEFAULT NULL | The type of hospital, found in hospital data | 'hospital' |
entities.created | timestamp | NOT NULL DEFAULT '0000-00-00 00:00:00' | The date and time the row was created | '2010-05-18 09:15:36' |
entities.modified | timestamp | NOT 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_hospitals, entity_ascs, entity_geographies, entity_values, and entity_calculations