salix/db/versions/.archive/10716-chocolateCamellia/00-firstScript.sql

18 lines
584 B
SQL

CREATE TABLE vn.transitoryDuaUnified (
id INT auto_increment NOT NULL,
supplierFk INT(10) UNSIGNED NULL,
CONSTRAINT transitoryDuaUnified_PK PRIMARY KEY (id),
CONSTRAINT transitoryDuaUnified_FK FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci
COMMENT='Transitarios que al contabilizar sus entradas sólo generan un único DUA para todos los proveedores';
INSERT INTO vn.transitoryDuaUnified (supplierFk)
SELECT id
FROM vn.supplier
WHERE name = 'VALLINOTO CARGO SA';