Revision 8597
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/VegCore/VegCore.my.sql | ||
---|---|---|
1086 | 1086 |
|
1087 | 1087 |
|
1088 | 1088 |
-- ----------------------------------------------------- |
1089 |
-- Table `party_list`
|
|
1089 |
-- Table `organization`
|
|
1090 | 1090 |
-- ----------------------------------------------------- |
1091 |
CREATE TABLE IF NOT EXISTS `party_list` ( |
|
1092 |
`list_id` TEXT NOT NULL , |
|
1093 |
`party` TEXT NOT NULL , |
|
1094 |
`sort_order` INT(11) NULL , |
|
1095 |
PRIMARY KEY (`list_id`, `party`) , |
|
1096 |
INDEX `fk_party_list_party1` (`party` ASC) , |
|
1097 |
INDEX `party_list_sorted` (`list_id` ASC, `sort_order` ASC) , |
|
1098 |
CONSTRAINT `fk_collection_source101` |
|
1099 |
FOREIGN KEY () |
|
1100 |
REFERENCES `record` () |
|
1101 |
ON DELETE CASCADE |
|
1102 |
ON UPDATE CASCADE, |
|
1103 |
CONSTRAINT `fk_party_list_party1` |
|
1104 |
FOREIGN KEY (`party` ) |
|
1091 |
CREATE TABLE IF NOT EXISTS `organization` ( |
|
1092 |
`id` TEXT NOT NULL , |
|
1093 |
`info` SET('hstore') NULL , |
|
1094 |
PRIMARY KEY (`id`) , |
|
1095 |
CONSTRAINT `fk_organization_party1` |
|
1096 |
FOREIGN KEY (`id` ) |
|
1105 | 1097 |
REFERENCES `party` (`id` ) |
1106 | 1098 |
ON DELETE CASCADE |
1107 | 1099 |
ON UPDATE CASCADE) |
... | ... | |
1111 | 1103 |
|
1112 | 1104 |
|
1113 | 1105 |
-- ----------------------------------------------------- |
1114 |
-- Table `organization`
|
|
1106 |
-- Table `event_participant`
|
|
1115 | 1107 |
-- ----------------------------------------------------- |
1116 |
CREATE TABLE IF NOT EXISTS `organization` ( |
|
1117 |
`id` TEXT NOT NULL , |
|
1118 |
`info` SET('hstore') NULL , |
|
1119 |
PRIMARY KEY (`id`) , |
|
1120 |
CONSTRAINT `fk_organization_party1` |
|
1121 |
FOREIGN KEY (`id` ) |
|
1108 |
CREATE TABLE IF NOT EXISTS `event_participant` ( |
|
1109 |
`event_id` TEXT NOT NULL , |
|
1110 |
`party_id` TEXT NOT NULL , |
|
1111 |
`sort_order` INT NULL , |
|
1112 |
PRIMARY KEY (`event_id`, `party_id`) , |
|
1113 |
INDEX `fk_event_has_party_party1` (`party_id` ASC) , |
|
1114 |
INDEX `fk_event_has_party_event1` (`event_id` ASC) , |
|
1115 |
CONSTRAINT `fk_event_has_party_event1` |
|
1116 |
FOREIGN KEY (`event_id` ) |
|
1117 |
REFERENCES `event` (`id` ) |
|
1118 |
ON DELETE CASCADE |
|
1119 |
ON UPDATE CASCADE, |
|
1120 |
CONSTRAINT `fk_event_has_party_party1` |
|
1121 |
FOREIGN KEY (`party_id` ) |
|
1122 | 1122 |
REFERENCES `party` (`id` ) |
1123 | 1123 |
ON DELETE CASCADE |
1124 | 1124 |
ON UPDATE CASCADE) |
Also available in: Unified diff
schemas/VegCore/VegCore.ERD.mwb: replaced party_list with event_participant many:many table, since the nature of each type of party_list (ordered, not, etc.) may differ between tables that HAVE-A party_list, and because it is not possible to create an fkey to a column that is not unique in the referenced table (as is the case for party_list.list_id)