asset setup
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 Mar 2005 07:08:40 +0000 (07:08 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 Mar 2005 07:08:40 +0000 (07:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@365 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/asset.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm
Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
Open-ILS/src/sql/Postgres/build-db-Postgres.sh

index 9781f1e..55bb758 100644 (file)
@@ -281,15 +281,21 @@ sub import {
        #-------------------------------------------------------------------------------
 
        #-------------------------------------------------------------------------------
+       asset::copy_note->has_a( owning_copy => 'asset::copy' );
+       #-------------------------------------------------------------------------------
        asset::copy->has_a( call_number => 'asset::call_number' );
+       asset::copy->has_many( notes => 'asset::copy_note' );
+       asset::copy->has_a( creator => 'actor::user' );
+       asset::copy->has_a( editor => 'actor::user' );
        #asset::copy->might_have( metadata => 'asset::copy_metadata' );
        #-------------------------------------------------------------------------------
-       #asset::copy_metadata->might_have( copy => 'asset::copy' );
-       asset::copy_metadata->has_a( circulating_location => 'actor::org_unit');
-       asset::copy_metadata->has_a( hold_radius => 'actor::org_unit_type');
+       asset::call_number_note->has_a( owning_call_number => 'asset::call_number' );
        #-------------------------------------------------------------------------------
        asset::call_number->has_a( record => 'biblio::record_entry' );
        asset::call_number->has_many( copies => 'asset::copy' );
+       asset::call_number->has_many( notes => 'asset::call_number_note' );
+       asset::call_number->has_a( creator => 'actor::user' );
+       asset::call_number->has_a( editor => 'actor::user' );
        #-------------------------------------------------------------------------------
        
 
index 7a24db8..96dd471 100644 (file)
@@ -10,7 +10,15 @@ use base qw/asset/;
 
 __PACKAGE__->table( 'asset_call_number' );
 __PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Others => qw/record label/ );
+__PACKAGE__->columns( Others => qw/record label creator create_date editor edit_date record label owning_lib/ );
+
+#-------------------------------------------------------------------------------
+package asset::call_number_note;
+use base qw/asset/;
+
+__PACKAGE__->table( 'asset_call_number' );
+__PACKAGE__->columns( Primary => qw/id/ );
+__PACKAGE__->columns( Others => qw/owning_call_number title creator create_date value/ );
 
 #-------------------------------------------------------------------------------
 package asset::copy;
@@ -18,16 +26,18 @@ use base qw/asset/;
 
 __PACKAGE__->table( 'asset_copy' );
 __PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Others => qw/call_number barcode/ );
+__PACKAGE__->columns( Others => qw/call_number barcode creator create_date editor edit_date copy_number status home_lib loan_duration fine_level circulate deposit price ref opac_visible genre audience shelving_loc/ );
 
 #-------------------------------------------------------------------------------
-package asset::copy_metadata;
+package asset::copy_note;
 use base qw/asset/;
 
-__PACKAGE__->table( 'asset_copy_metadata' );
+__PACKAGE__->table( 'asset_call_number' );
 __PACKAGE__->columns( Primary => qw/id/ );
-__PACKAGE__->columns( Others => qw/checkout_status circulating_location hold_radius/ );
+__PACKAGE__->columns( Others => qw/owning_copy title creator create_date value/ );
 
 #-------------------------------------------------------------------------------
+
+
 1;
 
index 3e29c67..5d24794 100644 (file)
 
 {
        #---------------------------------------------------------------------
+       package asset::call_number_note;
+       
+       asset::call_number->table( 'asset.call_number_note' );
+       asset::call_number->sequence( 'asset.call_number_note_id_seq' );
+       
+       #---------------------------------------------------------------------
+       package asset::copy_note;
+       
+       asset::copy->table( 'asset.copy_note' );
+       asset::copy->sequence( 'asset.copy_note_id_seq' );
+
+       #---------------------------------------------------------------------
        package asset::call_number;
        
        asset::call_number->table( 'asset.call_number' );
index 542930d..f0f6e0d 100644 (file)
@@ -66,6 +66,11 @@ sub _init {
                'Fieldmapper::metabib::subject_field_entry'     => { hint => 'msfe' },
                'Fieldmapper::metabib::keyword_field_entry'     => { hint => 'mkfe' },
                'Fieldmapper::metabib::full_rec'                => { hint => 'mfr'  },
+
+               'Fieldmapper::asset::copy'                      => { hint => 'acp'  },
+               'Fieldmapper::asset::copy_note'                 => { hint => 'acpn' },
+               'Fieldmapper::asset::call_number'               => { hint => 'acn'  },
+               'Fieldmapper::asset::call_number_note'          => { hint => 'acnn' },
        };
 
        #-------------------------------------------------------------------------------
index 25065d2..6c78950 100755 (executable)
@@ -5,7 +5,11 @@ psql -U $1 -d $2 -f 005.schema.actors.sql
 psql -U $1 -d $2 -f 010.schema.biblio.sql
 psql -U $1 -d $2 -f 020.schema.functions.sql
 psql -U $1 -d $2 -f 030.schema.metabib.sql
+psql -U $1 -d $2 -f 040.schema.asset.sql
+
 #psql -U $1 -d $2 -f 805.fkeys.actors.sql
 #psql -U $1 -d $2 -f 810.fkeys.biblio.sql
 #psql -U $1 -d $2 -f 830.fkeys.metabib.sql
+#psql -U $1 -d $2 -f 840.fkeys.asset.sql
+
 #psql -U $1 -d $2 -f 910.audit.biblio.sql