From 6a51879433f5f906dff2c5df59725e8bc8007cbe Mon Sep 17 00:00:00 2001 From: scottmk Date: Wed, 28 Oct 2009 16:57:09 +0000 Subject: [PATCH] Add CREATE statement for asset.copy_location_order M Pg/040.schema.asset.sql git-svn-id: svn://svn.open-ils.org/ILS/trunk@14651 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/040.schema.asset.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index 1f25cfe5e..a5d168d5e 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -32,6 +32,21 @@ CREATE TABLE asset.copy_location ( CONSTRAINT acl_name_once_per_lib UNIQUE (name, owning_lib) ); +CREATE TABLE asset.copy_location_order +( + id SERIAL PRIMARY KEY, + location INT NOT NULL + REFERENCES asset.copy_location + ON DELETE CASCADE + DEFERRABLE INITIALLY DEFERRED, + org INT NOT NULL + REFERENCES actor.org_unit + ON DELETE CASCADE + DEFERRABLE INITIALLY DEFERRED, + position INT NOT NULL DEFAULT 0, + CONSTRAINT acplo_once_per_org UNIQUE ( location, org ) +); + CREATE TABLE asset.copy ( id BIGSERIAL PRIMARY KEY, circ_lib INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED, -- 2.11.0