Création module PlanificationLivraison pour gérer le stockage en BDD du planning de livraison

This commit is contained in:
2021-02-19 21:03:07 +01:00
parent b688d5e161
commit fa7ef7c6d3
39 changed files with 351 additions and 1698 deletions

View File

@@ -0,0 +1,36 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
-- ---------------------------------------------------------------------
-- order_delivery_schedule
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `order_delivery_schedule`;
CREATE TABLE `order_delivery_schedule`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`order_id` INTEGER,
`delivery_address_id` INTEGER NOT NULL,
`schedule_id` INTEGER NOT NULL,
`due_delivery_time_start` DATETIME NOT NULL,
`due_delivery_time_end` DATETIME NOT NULL,
PRIMARY KEY (`id`),
INDEX `fi_order_delivery_schedule_order_id` (`order_id`),
INDEX `fi_order_delivery_address_id` (`delivery_address_id`),
INDEX `fi_order_delivery_schedule_id` (`schedule_id`),
CONSTRAINT `fk_order_delivery_schedule_order_id`
FOREIGN KEY (`order_id`)
REFERENCES `order` (`id`),
CONSTRAINT `fk_order_delivery_address_id`
FOREIGN KEY (`delivery_address_id`)
REFERENCES `order_address` (`id`),
CONSTRAINT `fk_order_delivery_schedule_id`
FOREIGN KEY (`schedule_id`)
REFERENCES `lps_area_schedule` (`id`)
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;