--- /dev/null
+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(),
+ recv_method TEXT NOT NULL REFERENCES acq.invoice_method (code) DEFAULT 'EDI',
+ container_code TEX 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;
+