LivraisonParSecteur : Rajout de la gestion du minimum de commande

This commit is contained in:
2021-02-25 14:56:55 +01:00
parent fffc4430c5
commit 4780bf1ff6
26 changed files with 256 additions and 100 deletions

View File

@@ -1,8 +1,8 @@
INSERT INTO `lps_area`(`id`,`title`) VALUES
(1, 'Capso'),
(2, 'Pays de Lumbres'),
(3, 'Haut des Flandres'),
(4, 'Flandres intérieur');
INSERT INTO `lps_area`(`id`,`title`,`minimum_amount`) VALUES
(1, 'Capso', 15.0),
(2, 'Pays de Lumbres', 15.0),
(3, 'Haut des Flandres', 15.0),
(4, 'Flandres intérieur', 15.0);

View File

@@ -8,6 +8,7 @@
<column name="title" required="true" size="50" type="VARCHAR" />
<column name="active" required="true" type="TINYINT" defaultValue="1" />
<column name="price" required="true" type="FLOAT" defaultValue="0" />
<column name="minimum_amount" required="true" type="FLOAT" defaultValue="15" />
<behavior name="timestampable" />
</table>

View File

@@ -1,2 +0,0 @@
# Sqlfile -> Database map
thelia.sql=thelia

View File

@@ -1,71 +0,0 @@
# 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;
-- ---------------------------------------------------------------------
-- lps_area
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area`;
CREATE TABLE `lps_area`
(
`id` INTEGER NOT NULL,
`title` VARCHAR(50) NOT NULL,
`active` TINYINT DEFAULT 1 NOT NULL,
`price` FLOAT DEFAULT 0 NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- lps_area_city
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area_city`;
CREATE TABLE `lps_area_city`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id_area` INTEGER NOT NULL,
`zipcode` VARCHAR(10) NOT NULL,
`title` VARCHAR(50) NOT NULL,
`latitude` DOUBLE,
`longitude` DOUBLE,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `fi_area_area_city` (`id_area`),
CONSTRAINT `fk_area_area_city`
FOREIGN KEY (`id_area`)
REFERENCES `lps_area` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- lps_area_schedule
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area_schedule`;
CREATE TABLE `lps_area_schedule`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id_area` INTEGER NOT NULL,
`day` INTEGER NOT NULL,
`begin_time` TIME NOT NULL,
`end_time` TIME NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `fi_area_area_schedule` (`id_area`),
CONSTRAINT `fk_area_area_schedule`
FOREIGN KEY (`id_area`)
REFERENCES `lps_area` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;