Lines 241-250
DROP TABLE IF EXISTS `additional_field_values`;
Link Here
|
241 |
CREATE TABLE `additional_field_values` ( |
241 |
CREATE TABLE `additional_field_values` ( |
242 |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier', |
242 |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier', |
243 |
`field_id` int(11) NOT NULL COMMENT 'foreign key references additional_fields(id)', |
243 |
`field_id` int(11) NOT NULL COMMENT 'foreign key references additional_fields(id)', |
|
|
244 |
`record_table` varchar(255) NOT NULL DEFAULT '' COMMENT 'tablename of the related record', |
244 |
`record_id` int(11) NOT NULL COMMENT 'record_id', |
245 |
`record_id` int(11) NOT NULL COMMENT 'record_id', |
245 |
`value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field', |
246 |
`value` varchar(255) NOT NULL DEFAULT '' COMMENT 'value for this field', |
246 |
PRIMARY KEY (`id`), |
247 |
PRIMARY KEY (`id`), |
247 |
UNIQUE KEY `field_record` (`field_id`,`record_id`), |
248 |
UNIQUE KEY `field_record` (`field_id`,`record_id`), |
|
|
249 |
KEY `record_table` (`record_table`), |
248 |
CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
250 |
CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
249 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
251 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
250 |
/*!40101 SET character_set_client = @saved_cs_client */; |
252 |
/*!40101 SET character_set_client = @saved_cs_client */; |
251 |
- |
|
|