footnotes_values

Summary

This table provides information regarding the relationships of the values of their measures and the footnotes that need to be associated with them. This table links both the 'measures' table and the 'entity_values' table to the 'footnotes' table.

This table uses all five fields to create a concatenated key to keep track of unique entries. These five fields are measure_id, entity_id, date_start, date_end, and footnote_id.

Duplications can exist in this table for any of these fields, but all five can never be exact matches.

 

Table Creation

CREATE TABLE IF NOT EXISTS `footnotes_values` (
`measure_id` int(11) NOT NULL,
`entity_id` bigint(20) unsigned NOT NULL,
`date_start` date NOT NULL,
`date_end` date NOT NULL,
`footnote_id` int(11) NOT NULL,
`batch_id` varchar(64) DEFAULT NULL,
UNIQUE KEY `footnote_id` (`measure_id`,`entity_id`,`date_start`,`date_end`,`footnote_id`),
KEY `footnotes_ibfk2` (`footnote_id`),
KEY `footnotes_batch` (`batch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


ALTER TABLE `footnotes_values`
ADD CONSTRAINT `footnotes_ibfk2` FOREIGN KEY (`footnote_id`) REFERENCES `footnotes` (`footnote_id`) ON DELETE CASCADE,
ADD CONSTRAINT `footnotes_values_ibfk1` FOREIGN KEY (`measure_id`, `entity_id`, `date_start`, `date_end`) REFERENCES `entity_values` (`measure_id`, `entity_id`, `date_start`, `date_end`) ON DELETE CASCADE;

 

Fields

fieldtypeattributesnotesexample
footnotes_values.measure_idint(11)NOT NULLProvided by Pellucid, FOREIGN KEY: links to measures01234560
footnotes_values.entity_idbigint(20)UNSIGNED NOT NULLProvided by Pellucid, FOREIGN KEY: links to entities01234567890
footnotes_values.date_startdateNOT NULLSame as field in entity_values, YYYY-MM-DD2009-01-01
footnotes_values.date_enddateNOT NULLSame as field in entity_values, YYYY-MM-DD2009-12-31
footnotes_values.footnote_idint(11)NOT NULLProvided by Pellucid, FOREIGN KEY: links to footnotes2456
footnotes_values.batch_id   varchar(64) 
DEFAULT NULLBatch IDWNTB20120923