WIP: refactor: refs #8172 Created table parkingCoordinates #3320
File diff suppressed because it is too large
Load Diff
|
@ -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,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"column": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"row": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue