INSERT INTO contenedores(numero,tipo_id,iso_id,created_at)
SELECT contenedor AS numero, tcont AS tipo_id, isocode AS iso_id, `mod` AS created_at
FROM inventario
GROUP BY contenedor;
UPDATE inventario, contenedores SET inventario.contenedor = contenedores.id WHERE inventario.contenedor = contenedores.numero;
UPDATE inventario, viajes SET inventario.viajed = viajes.id WHERE inventario.linea = viajes.linea_id AND inventario.buqued = viajes.buque_id;
