From: miker Date: Sun, 8 Feb 2009 02:12:31 +0000 (+0000) Subject: adding note tables for all bucket and item tables; adding pos field for optional... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=810bd86638121137630dc13dd4b6a50e3c03ac97;p=evergreen%2Ftadl.git adding note tables for all bucket and item tables; adding pos field for optional ordering of items within a bucket git-svn-id: svn://svn.open-ils.org/ILS/trunk@12104 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/070.schema.container.sql b/Open-ILS/src/sql/Pg/070.schema.container.sql index 2ae297c5a0..f10545df82 100644 --- a/Open-ILS/src/sql/Pg/070.schema.container.sql +++ b/Open-ILS/src/sql/Pg/070.schema.container.sql @@ -40,6 +40,12 @@ CREATE TABLE container.copy_bucket ( CONSTRAINT cb_name_once_per_owner UNIQUE (owner,name,btype) ); +CREATE TABLE container.copy_bucket_note ( + id SERIAL PRIMARY KEY, + bucket INT NOT NULL REFERENCES container.copy_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + CREATE TABLE container.copy_bucket_item ( id SERIAL PRIMARY KEY, bucket INT NOT NULL @@ -54,9 +60,15 @@ CREATE TABLE container.copy_bucket_item ( ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + pos INT, create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); +CREATE TABLE container.copy_bucket_item_note ( + id SERIAL PRIMARY KEY, + item INT NOT NULL REFERENCES container.copy_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); @@ -80,6 +92,12 @@ CREATE TABLE container.call_number_bucket ( CONSTRAINT cnb_name_once_per_owner UNIQUE (owner,name,btype) ); +CREATE TABLE container.call_number_bucket_note ( + id SERIAL PRIMARY KEY, + bucket INT NOT NULL REFERENCES container.call_number_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + CREATE TABLE container.call_number_bucket_item ( id SERIAL PRIMARY KEY, bucket INT NOT NULL @@ -94,9 +112,17 @@ CREATE TABLE container.call_number_bucket_item ( ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + pos INT, create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); +CREATE TABLE container.call_number_bucket_item_note ( + id SERIAL PRIMARY KEY, + item INT NOT NULL REFERENCES container.call_number_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + + CREATE TABLE container.biblio_record_entry_bucket_type ( @@ -120,6 +146,12 @@ CREATE TABLE container.biblio_record_entry_bucket ( CONSTRAINT breb_name_once_per_owner UNIQUE (owner,name,btype) ); +CREATE TABLE container.biblio_record_entry_bucket_note ( + id SERIAL PRIMARY KEY, + bucket INT NOT NULL REFERENCES container.biblio_record_entry_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + CREATE TABLE container.biblio_record_entry_bucket_item ( id SERIAL PRIMARY KEY, bucket INT NOT NULL @@ -134,9 +166,16 @@ CREATE TABLE container.biblio_record_entry_bucket_item ( ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + pos INT, create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); +CREATE TABLE container.biblio_record_entry_bucket_item_note ( + id SERIAL PRIMARY KEY, + item INT NOT NULL REFERENCES container.biblio_record_entry_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + CREATE TABLE container.user_bucket_type ( @@ -159,6 +198,12 @@ CREATE TABLE container.user_bucket ( CONSTRAINT ub_name_once_per_owner UNIQUE (owner,name,btype) ); +CREATE TABLE container.user_bucket_note ( + id SERIAL PRIMARY KEY, + bucket INT NOT NULL REFERENCES container.user_bucket (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + CREATE TABLE container.user_bucket_item ( id SERIAL PRIMARY KEY, bucket INT NOT NULL @@ -173,7 +218,15 @@ CREATE TABLE container.user_bucket_item ( ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + pos INT, create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); +CREATE TABLE container.user_bucket_item_note ( + id SERIAL PRIMARY KEY, + item INT NOT NULL REFERENCES container.user_bucket_item (id) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED, + note TEXT NOT NULL +); + + COMMIT;