WIP: refactor: refs #8172 Created table parkingCoordinates #3320

Draft
guillermo wants to merge 2 commits from 8172-parkingCoordinates into dev
2 changed files with 2437 additions and 2412 deletions
Showing only changes of commit 6300795e52 - Show all commits

File diff suppressed because it is too large Load Diff

View File

@ -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`;