Se ajusto la tabla de quantity y de packeges, y se creo la relacion

This commit is contained in:
2026-01-27 11:34:10 -06:00
parent 50504be30b
commit c97b9e3daf
8 changed files with 42 additions and 5 deletions

10
fix_data.sql Normal file
View File

@@ -0,0 +1,10 @@
-- Actualizar el nuevo campo package_id usando el valor numérico guardado erróneamente en package_key
UPDATE a76.item_line_quantities
SET
package_id = CAST(package_key AS INTEGER)
WHERE
package_key ~ '^\d+$'
AND package_id IS NULL;
-- Opcional: Limpiar el campo package_key si ya se migró (para evitar confusión futura, pero mejor dejarlo por seguridad)
-- UPDATE a76.item_line_quantities SET package_key = NULL WHERE package_id IS NOT NULL;