LP1883171 & LP1940663: Database & IDL updates for copy inventory table
authorJason Stephenson <jason@sigio.com>
Sun, 24 Oct 2021 16:54:31 +0000 (12:54 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Fri, 4 Feb 2022 19:39:18 +0000 (14:39 -0500)
commit3ef2d1885065e2663b8fc3511d65e74888d83185
treee60761db3e5572fca45dff713cd52bb0cc3f5dad
parente7b98ca69a9d58d47fc71ea13d14ef1478c5afb2
LP1883171 & LP1940663: Database & IDL updates for copy inventory table

Add new asset.copy_inventory table with constraints:
  * Foreign Key on copy -> asset.copy.id
  * Unique index on inventory_date and copy
  * Require that copy is at home or may float to inventory_workstation org.

Add IDL entry for asset.copy_inventory table (aci).

Change asset.latest_inventory table into a view.

Mark the asset.latest_inventory IDL entry (alci) read-only.

Provide database upgrade script to make the database changes and move
entries from the asset.latest_inventory table to the
asset.copy_inventory table.

Add pgtap schema tests to validate that the above tables, views, and
constraints exist.

Add pgtap live tests to validate that the table and view constraints
work as intended.

This work was sponsored by NOBLE.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/src/sql/Pg/800.fkeys.sql
Open-ILS/src/sql/Pg/live_t/lp1883171-copy_inventory.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/t/lp1883171-copy_inventory-schema.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_inventory.sql [new file with mode: 0644]