adding bucket types to each bucket class; adding vfields for bucket stuff to fieldmapper
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Dec 2005 17:58:46 +0000 (17:58 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Dec 2005 17:58:46 +0000 (17:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2266 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/container.pm
Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
Open-ILS/src/sql/Pg/070.schema.container.sql

index 12cef25..fcc5d8d 100644 (file)
@@ -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;
index 0bac40a..d153d98 100644 (file)
@@ -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'   },
index 7dc026a..2be13c4 100644 (file)
@@ -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 (