From b2680f76eae03e7532c46f1474f6b8f535753a31 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 7 Dec 2005 17:58:46 +0000 Subject: [PATCH] adding bucket types to each bucket class; adding vfields for bucket stuff to fieldmapper git-svn-id: svn://svn.open-ils.org/ILS/trunk@2266 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/CDBI/container.pm | 8 ++++---- Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm | 12 ++++++++---- Open-ILS/src/sql/Pg/070.schema.container.sql | 12 ++++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/container.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/container.pm index 12cef25b51..fcc5d8d0ee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/container.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/container.pm @@ -9,7 +9,7 @@ package container::user_bucket; use base qw/container/; container::user_bucket->table( 'container_user_bucket' ); -container::user_bucket->columns( All => qw/id owner name/ ); +container::user_bucket->columns( All => qw/id owner name btype/ ); #------------------------------------------------------------------------------- package container::user_bucket_item; @@ -23,7 +23,7 @@ package container::copy_bucket; use base qw/container/; container::copy_bucket->table( 'container_copy_bucket' ); -container::copy_bucket->columns( All => qw/id owner name/ ); +container::copy_bucket->columns( All => qw/id owner name btype/ ); #------------------------------------------------------------------------------- package container::copy_bucket_item; @@ -37,7 +37,7 @@ package container::biblio_record_entry_bucket; use base qw/container/; container::biblio_record_entry_bucket->table( 'container_biblio_record_entry_bucket' ); -container::biblio_record_entry_bucket->columns( All => qw/id owner name/ ); +container::biblio_record_entry_bucket->columns( All => qw/id owner name btype/ ); #------------------------------------------------------------------------------- package container::biblio_record_entry_bucket_item; @@ -51,7 +51,7 @@ package container::call_number_bucket; use base qw/container/; container::call_number_bucket->table( 'container_call_number_bucket' ); -container::call_number_bucket->columns( All => qw/id owner name/ ); +container::call_number_bucket->columns( All => qw/id owner name btype/ ); #------------------------------------------------------------------------------- package container::call_number_bucket_item; diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm b/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm index 0bac40a399..d153d989b2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm @@ -51,10 +51,14 @@ sub _init { $fieldmap = { - 'Fieldmapper::container::user_bucket' => { hint => 'cub' }, - 'Fieldmapper::container::copy_bucket' => { hint => 'ccb' }, - 'Fieldmapper::container::call_number_bucket' => { hint => 'ccnb' }, - 'Fieldmapper::container::biblio_record_entry_bucket' => { hint => 'cbreb' }, + 'Fieldmapper::container::user_bucket' => { hint => 'cub', + proto_fields => { items => 1 } }, + 'Fieldmapper::container::copy_bucket' => { hint => 'ccb', + proto_fields => { items => 1 } }, + 'Fieldmapper::container::call_number_bucket' => { hint => 'ccnb', + proto_fields => { items => 1 } }, + 'Fieldmapper::container::biblio_record_entry_bucket' => { hint => 'cbreb', + proto_fields => { items => 1 } }, 'Fieldmapper::container::user_bucket_item' => { hint => 'cubi' }, 'Fieldmapper::container::copy_bucket_item' => { hint => 'ccbi' }, diff --git a/Open-ILS/src/sql/Pg/070.schema.container.sql b/Open-ILS/src/sql/Pg/070.schema.container.sql index 7dc026a52e..2be13c4968 100644 --- a/Open-ILS/src/sql/Pg/070.schema.container.sql +++ b/Open-ILS/src/sql/Pg/070.schema.container.sql @@ -12,7 +12,8 @@ CREATE TABLE container.copy_bucket ( DEFERRABLE INITIALLY DEFERRED, name TEXT NOT NULL, - CONSTRAINT cb_name_once_per_owner UNIQUE (owner,name) + btype TEXT NOT NULL DEFAULT 'misc', + CONSTRAINT cb_name_once_per_owner UNIQUE (owner,name,btype) ); CREATE TABLE container.copy_bucket_item ( @@ -44,7 +45,8 @@ CREATE TABLE container.call_number_bucket ( DEFERRABLE INITIALLY DEFERRED, name TEXT NOT NULL, - CONSTRAINT cnb_name_once_per_owner UNIQUE (owner,name) + btype TEXT NOT NULL DEFAULT 'misc', + CONSTRAINT cnb_name_once_per_owner UNIQUE (owner,name,btype) ); CREATE TABLE container.call_number_bucket_item ( @@ -76,7 +78,8 @@ CREATE TABLE container.biblio_record_entry_bucket ( DEFERRABLE INITIALLY DEFERRED, name TEXT NOT NULL, - CONSTRAINT breb_name_once_per_owner UNIQUE (owner,name) + btype TEXT NOT NULL DEFAULT 'misc', + CONSTRAINT breb_name_once_per_owner UNIQUE (owner,name,btype) ); CREATE TABLE container.biblio_record_entry_bucket_item ( @@ -108,7 +111,8 @@ CREATE TABLE container.user_bucket ( DEFERRABLE INITIALLY DEFERRED, name TEXT NOT NULL, - CONSTRAINT ub_name_once_per_owner UNIQUE (owner,name) + btype TEXT NOT NULL DEFAULT 'misc', + CONSTRAINT ub_name_once_per_owner UNIQUE (owner,name,btype) ); CREATE TABLE container.user_bucket_item ( -- 2.43.2