From: Bill Erickson Date: Wed, 1 Dec 2021 17:55:13 +0000 (-0500) Subject: LP1952931 ASN shipment notification SQL X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3589e16e06eb5e9f8c2664f25f8660dbf41e1511;p=working%2FEvergreen.git LP1952931 ASN shipment notification SQL Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 35eaebcacd..d7d5241135 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -9539,6 +9539,68 @@ SELECT usr, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.acq-asn.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.acq-asn.sql new file mode 100644 index 0000000000..c4458905ea --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.acq-asn.sql @@ -0,0 +1,33 @@ +BEGIN; + +-- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); + +CREATE TABLE acq.shipment_notification ( + id SERIAL PRIMARY KEY, + receiver INT NOT NULL REFERENCES actor.org_unit (id), + provider INT NOT NULL REFERENCES acq.provider (id), + shipper INT NOT NULL REFERENCES acq.provider (id), + recv_date TIMESTAMPTZ NOT NULL DEFAULT NOW(), + container_code TEXT NOT NULL, -- vendor-supplied super-barcode + lading_number TEXT, -- informational + note TEXT, + CONSTRAINT container_code_once_per_provider UNIQUE(provider, container_code) +); + +CREATE INDEX acq_asn_container_code_idx ON acq.shipment_notification (container_code); + +CREATE TABLE acq.shipment_notification_entry ( + id SERIAL PRIMARY KEY, + shipment_notification INT NOT NULL REFERENCES acq.invoice (id) ON DELETE CASCADE, + lineitem INT REFERENCES acq.lineitem (id) ON UPDATE CASCADE ON DELETE SET NULL, + item_count INT NOT NULL -- How many items the provider shipped +); + +COMMIT; + +/* UNDO + +DROP TABLE acq.shipment_notification_entry; +DROP TABLE acq.shipment_notification; + +*/