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;

INSERT INTO vn.parkingCoordinates (parkingFk, x, y, z)
	SELECT id, `column`, `row`, `floor`
		FROM vn.parking
		WHERE `column` IS NOT NULL
			OR `row` IS NOT NULL
			OR `floor` IS NOT NULL;

ALTER TABLE vn.parking
	DROP COLUMN `column`,
	DROP COLUMN `row`,
	DROP COLUMN `floor`;
