Revision 11058
Added by Aaron Marcuse-Kubitza over 10 years ago
VegCore.my.sql | ||
---|---|---|
1420 | 1420 |
CREATE TABLE `traceable` ( |
1421 | 1421 |
`id` varbinary(767) NOT NULL, |
1422 | 1422 |
`source` varbinary(767) NOT NULL, |
1423 |
`table_fragment` varbinary(767) DEFAULT NULL COMMENT 'the portion of the source that this traceable refers to. when specified, this must *uniquely identify* the traceable within the source. denormalized source data often contains data for many VegCore tables in the same row, and the traceables for each of these table entries must be distinguished *from each other* since they share the same source. this is usually just the VegCore table name, sometimes with a distinguishing prefix (e.g. collector.party/identified_by.party; current_observation.taxon_determination/orig_observation.taxon_determination).',
|
|
1423 |
`id_within_source` varbinary(767) DEFAULT NULL COMMENT 'the portion of the source that this traceable refers to. when specified, this must *uniquely identify* the traceable within the source. denormalized source data often contains data for many VegCore tables in the same row, and the traceables for each of these table entries must be distinguished *from each other* since they share the same source. this is usually just the VegCore table name, sometimes with a distinguishing prefix (e.g. collector.party/identified_by.party; current_observation.taxon_determination/orig_observation.taxon_determination). this can also identify e.g. a dataset within the source that it came from.',
|
|
1424 | 1424 |
PRIMARY KEY (`id`), |
1425 |
UNIQUE KEY `traceable_unique` (`source`,`table_fragment`),
|
|
1425 |
UNIQUE KEY `traceable_unique` (`source`,`id_within_source`),
|
|
1426 | 1426 |
CONSTRAINT `fk_record_source1` FOREIGN KEY (`source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
1427 | 1427 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='a row that can have associated source information'; |
1428 | 1428 |
/*!40101 SET character_set_client = @saved_cs_client */; |
Also available in: Unified diff
schemas/VegCore/ERD/VegCore.ERD.mwb: traceable.table_fragment: renamed to id_within_source, since this can also identify e.g. a dataset within the source that it came from