12 lines
739 B
MySQL
12 lines
739 B
MySQL
|
CREATE TABLE floranet.`addressPostCode` (
|
||
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||
|
`addressFk` int(11) NOT NULL,
|
||
|
`postCode` varchar(30) NOT NULL,
|
||
|
`hoursInAdvance` int(10) unsigned NOT NULL DEFAULT 24,
|
||
|
`dayOfWeek` int(10) unsigned NOT NULL,
|
||
|
`deliveryCost` decimal(10,2) NOT NULL DEFAULT 0.00,
|
||
|
PRIMARY KEY (`id`),
|
||
|
UNIQUE KEY `addressPostCode_unique` (`postCode`,`addressFk`,`dayOfWeek`),
|
||
|
KEY `addressPostCode_address_FK` (`addressFk`),
|
||
|
CONSTRAINT `addressPostCode_address_FK` FOREIGN KEY (`addressFk`) REFERENCES `vn`.`address` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Client''s address registered for floranet network';
|