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.
MERGE NOTE: IDL permissions on the new real table were updated to
match previously modified permissions on the old real table.
This work was sponsored by NOBLE.
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>