Simplify serial.materialized_holding_code
authorDan Wells <dbw2@calvin.edu>
Fri, 30 Mar 2012 19:55:19 +0000 (15:55 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 2 Apr 2012 14:18:53 +0000 (10:18 -0400)
Attempting to materialize holding_type and ind1/ind2 for less than
perfect data causes problems.  Since we aren't actually using this
data, let's get rid of these fields.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.serial-holding-groups.sql

index d395430..695ce81 100644 (file)
@@ -70,9 +70,6 @@ $$ LANGUAGE SQL STABLE;
 CREATE TABLE serial.materialized_holding_code (
     id BIGSERIAL PRIMARY KEY,
     issuance INTEGER NOT NULL REFERENCES serial.issuance (id) ON DELETE CASCADE,
-    holding_type TEXT NOT NULL,
-    ind1 TEXT,
-    ind2 TEXT,
     subfield CHAR,
     value TEXT
 );
@@ -110,18 +107,15 @@ spi_exec_prepared($dstmt, $_TD->{new}{id});
 my $istmt = spi_prepare(
     q{
         INSERT INTO serial.materialized_holding_code (
-            issuance, holding_type, ind1, ind2, subfield, value
-        ) VALUES ($1, $2, $3, $4, $5, $6)
-    }, qw{INT TEXT TEXT TEXT CHAR TEXT}
+            issuance, subfield, value
+        ) VALUES ($1, $2, $3)
+    }, qw{INT CHAR TEXT}
 );
 
 foreach ($field->subfields) {
     spi_exec_prepared(
         $istmt,
         $_TD->{new}{id},
-        $_TD->{new}{holding_type},
-        $field->indicator(1),
-        $field->indicator(2),
         $_->[0],
         $_->[1]
     );