update fixtures and schema

This commit is contained in:
Bernat 2018-05-09 07:20:30 +02:00
parent a218cbf0e1
commit f6a7efae0c
9 changed files with 105 additions and 5 deletions

View File

@ -1,2 +1 @@
connect.ini
docker.log

View File

@ -19,7 +19,7 @@ else
# Import fixtures
echo "Imported fixtures.sql"
mysql -u root -proot < dump/fixtures.sql
mysql -u root -proot -f < dump/fixtures.sql
# Copy dumpted data to volume
cp -R /var/lib/mysql /data

View File

@ -23,8 +23,9 @@ VIEW `vn`.`item` AS
`t`.`relevancy` AS `relevancy`,
`t`.`Foto` AS `image`,
`t`.`generic` AS `generic`,
`t`.`density` AS `density`,
`t`.`iva_group_id` AS `taxClassFk`,
`t`.`pvp` AS `pvp`,
`t`.`min` AS `min`
`t`.`PVP` AS `minPrice`,
`t`.`Min` AS `hasMinPrice`
FROM
`vn2008`.`Articles` `t`;

View File

@ -0,0 +1,14 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`agencyProvince` AS
SELECT
`a`.`province_id` AS `provinceFk`,
`a`.`agency_id` AS `agencyFk`,
`a`.`zona` AS `zone`,
`a`.`warehouse_id` AS `warehouseFk`,
`a`.`route` AS `route`
FROM
`vn2008`.`Agencias_province` `a`;

View File

@ -0,0 +1,16 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`agencyModeZone` AS
SELECT
`a`.`Id_Agencia` AS `agencyModeFk`,
`a`.`zona` AS `zone`,
`a`.`price` AS `price`,
`a`.`Id_Article` AS `itemFk`,
`a`.`warehouse_id` AS `warehouseFk`,
`a`.`porte_minimo` AS `minimCost`,
`a`.`inflacion` AS `inflation`
FROM
`vn2008`.`Agencias_zonas` `a`;

View File

@ -0,0 +1,15 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`agencyWeekdayBonus` AS
SELECT
`a`.`id` AS `id`,
`a`.`warehouse_id` AS `warehouseFk`,
`a`.`agency_id` AS `agencyFk`,
`a`.`weekDay` AS `weekDay`,
`a`.`zona` AS `zone`,
`a`.`bonus` AS `bonus`
FROM
`vn2008`.`agency_weekday_bonus` `a`;

View File

@ -0,0 +1,12 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`preparationPercentage` AS
SELECT
`p`.`week_day` AS `weekDay`,
`p`.`warehouse_id` AS `warehouseFk`,
`p`.`percentage` AS `percentage`
FROM
`vn2008`.`preparation_percentage` `p`;

View File

@ -0,0 +1,12 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`preparationException` AS
SELECT
`p`.`exception_day` AS `exceptionDay`,
`p`.`warehouse_id` AS `warehouseFk`,
`p`.`percentage` AS `percentage`
FROM
`vn2008`.`preparation_exception` `p`;

View File

@ -612,4 +612,35 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`)
( 1, 1, CURDATE(), 1, 442),
( 2, 2, CURDATE(), 2, 442),
( 3, 1, CURDATE(), 3, 442),
( 4, 2, CURDATE(), 4, 69);
( 4, 2, CURDATE(), 4, 69);
INSERT INTO `vn`.`agencyProvince`(`provinceFk`, `agencyFk`, `zone`, `warehouseFk`, `route`)
VALUES
( 1, 1, 1, 1, 1),
( 1, 1, 1, 2, 1),
( 1, 1, 1, 3, 1),
( 1, 2, 2, 2, 2),
( 1, 2, 2, 3, 2);
INSERT INTO `vn`.`agencyModeZone`(`agencyModeFk`, `zone`, `price`, `itemFk`, `warehouseFk`, `minimCost`, `inflation`)
VALUES
( 1, 1, 10, 1, 1, 1, 1.00),
( 1, 1, 20, 2, 1, 1, 1.00),
( 2, 1, 10, 1, 1, 1, 1.00),
( 2, 1, 20, 2, 1, 1, 2.00),
( 2, 2, 10, 1, 1, 0, 2.00);
INSERT INTO `vn`.`agencyWeekdayBonus`(`id`, `warehouseFk`, `agencyFk`, `weekDay`, `zone`, `bonus`)
VALUES
( 1, 1, 1, 0, 1, -1.00),
( 2, 1, 1, 1, 1, -1.00),
( 3, 1, 1, 0, 2, -1.00),
( 4, 1, 1, 1, 2, -1.00),
( 5, 2, 2, 2, 3, 0);
INSERT INTO `bi`.`claims_ratio`(`id_Cliente`, `Consumo`, `Reclamaciones`, `Ratio`, `recobro`, `inflacion`)
VALUES
( 101, 500, NULL, 0.00, 0.00, 1.00),
( 102, 1000, 2.00, 0.01, 0.05, 1.00),
( 103, 2000, 0.00, 0.00, 0.02, 1.00),
( 104, 2500, 150.00, 0.02, 0.10, 1.00);