WIP: refactor: refs #8172 Created table parkingCoordinates #3320
|
@ -214,15 +214,15 @@ INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`,`bossFk`, `phone
|
||||||
(1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109),
|
(1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109),
|
||||||
(1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110);
|
(1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110);
|
||||||
|
|
||||||
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
|
INSERT INTO `vn`.`parking` (`id`, `sectorFk`, `code`, `pickingOrder`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', 700, '01', 1, '700-01', 70001),
|
('1', 1, '700-01', 70001),
|
||||||
('2', 700, '02', 2, '700-02', 70002),
|
('2', 2, '700-02', 70002),
|
||||||
('3', 100, '01', 1, '100-01', 1),
|
('3', 1, '100-01', 1),
|
||||||
(32397, 100, '02', 1, 'A-47-1', 1165),
|
(32397, 1, 'A-47-1', 1165),
|
||||||
(34831, 200, '01', 1, 'K-26-2', 20220),
|
(34831, 1, 'K-26-2', 20220),
|
||||||
(34965, 200, '02', 2, 'L-08-4', 21800),
|
(34965, 2, 'L-08-4', 21800),
|
||||||
(39096, 200, '03', 2, 'LR-02-3', 99999);
|
(39096, 2, 'LR-02-3', 99999);
|
||||||
|
|
||||||
INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `userFk`, `isRecyclable`)
|
INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `userFk`, `isRecyclable`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
CREATE TABLE vn.parkingCoordinates (
|
||||||
|
parkingFk int(11) NOT NULL,
|
||||||
|
x varchar(5) NOT NULL,
|
||||||
|
y varchar(5) NOT NULL,
|
||||||
|
z varchar(5) NOT NULL,
|
||||||
|
CONSTRAINT parkingCoordinates_pk PRIMARY KEY (parkingFk),
|
||||||
|
CONSTRAINT parkingCoordinates_parking_FK FOREIGN KEY (parkingFk) REFERENCES vn.parking(id) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
)
|
||||||
|
ENGINE=InnoDB
|
||||||
|
DEFAULT CHARSET=utf8mb3
|
||||||
|
COLLATE=utf8mb3_unicode_ci;
|
||||||
|
|
||||||
|
UPDATE vn.parkingCoordinates pc
|
||||||
|
JOIN vn.parking p ON p.id = pc.parkingFk
|
||||||
|
SET pc.x = IFNULL(p.`column`, 0),
|
||||||
|
pc.y = IFNULL(p.`row`, 0),
|
||||||
|
pc.z = IFNULL(p.`floor`, 0)
|
||||||
|
WHERE p.`column` IS NOT NULL
|
||||||
|
OR p.`row` IS NOT NULL
|
||||||
|
OR p.`floor` IS NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE vn.parking
|
||||||
|
DROP COLUMN `column`,
|
||||||
|
DROP COLUMN `row`,
|
||||||
|
DROP COLUMN `floor`;
|
|
@ -12,14 +12,6 @@
|
||||||
"id": true,
|
"id": true,
|
||||||
"description": "Identifier"
|
"description": "Identifier"
|
||||||
},
|
},
|
||||||
"column": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"row": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"code": {
|
"code": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue