-- Place your SQL code here
RENAME TABLE `vn`.`returnBuckets` TO `vn`.`returnBuckets__`;

ALTER TABLE `vn2008`.`Cubos_Retorno` RENAME `vn`.`returnBuckets`;


ALTER TABLE `vn`.`returnBuckets` 
CHANGE COLUMN `idCubos_Retorno` `id`  int(11) NOT NULL AUTO_INCREMENT,
CHANGE COLUMN `Soporte` `freightContainerType` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL,
CHANGE COLUMN `Vacio` `freightPackagingEmpty` DOUBLE NOT NULL DEFAULT 0,
CHANGE COLUMN `Lleno` `freightPackagingFull` DOUBLE NOT NULL DEFAULT 0;


CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `root`@`localhost`
    SQL SECURITY DEFINER
VIEW `vn2008`.`Cubos_Retorno` AS
    SELECT 
        `rb`.`id` AS `idCubos_Retorno`,
        `rb`.`freightContainerType` AS `Soporte`,
        `rb`.`freightPackagingEmpty` AS `Vacio`,
        `rb`.`freightPackagingFull` AS `Lleno`
    FROM
        `vn`.`returnBuckets` `rb`;
