fixups
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 May 2005 15:59:50 +0000 (15:59 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 May 2005 15:59:50 +0000 (15:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@702 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Postgres/002.schema.config.sql
Open-ILS/src/sql/Postgres/030.schema.metabib.sql
Open-ILS/src/sql/Postgres/800.fkeys.sql

index b05658c..652ee06 100644 (file)
@@ -19,15 +19,15 @@ CREATE TABLE config.standing (
 
 INSERT INTO config.standing (value) VALUES ('Good');
 INSERT INTO config.standing (value) VALUES ('Barred');
-INSERT INTO config.standing (value) VALUES ('Blocked');
 
 CREATE TABLE config.metabib_field (
        id              SERIAL  PRIMARY KEY,
-       field_class     TEXT    NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword')),
+       field_class     TEXT    NOT NULL CHECK (lower(field_class) IN ('title','author','subject','keyword','series')),
        name            TEXT    NOT NULL UNIQUE,
        xpath           TEXT    NOT NULL
 );
 
+INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'series', 'seriestitle', $$//mods:mods/mods:relatedItem[@type="series"]/mods:titleInfo$$ );
 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'abbreviated', $$//mods:mods/mods:titleInfo[mods:title and (@type='abreviated')]$$ );
 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'translated', $$//mods:mods/mods:titleInfo[mods:title and (@type='translated')]$$ );
 INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES ( 'title', 'uniform', $$//mods:mods/mods:titleInfo[mods:title and (@type='uniform')]$$ );
index 22ba90f..32d6180 100644 (file)
@@ -59,6 +59,17 @@ CREATE TRIGGER metabib_keyword_field_entry_fti_trigger
        BEFORE UPDATE OR INSERT ON metabib.keyword_field_entry
        FOR EACH ROW EXECUTE PROCEDURE tsearch2(index_vector, value);
 
+CREATE TABLE metabib.series_field_entry (
+       id              BIGSERIAL       PRIMARY KEY,
+       source          BIGINT          NOT NULL,
+       field           INT             NOT NULL,
+       value           TEXT            NOT NULL,
+       index_vector    tsvector        NOT NULL
+);
+CREATE TRIGGER metabib_series_field_entry_fti_trigger
+       BEFORE UPDATE OR INSERT ON metabib.series_field_entry
+       FOR EACH ROW EXECUTE PROCEDURE tsearch2(index_vector, value);
+
 CREATE TABLE metabib.rec_descriptor (
        id              BIGSERIAL PRIMARY KEY,
        record          BIGINT,
index a871aa0..b726bf5 100644 (file)
@@ -11,7 +11,7 @@ ALTER TABLE actor.stat_cat_entry ADD CONSTRAINT actor_stat_cat_entry_stat_cat_fk
 ALTER TABLE actor.stat_cat_entry ADD CONSTRAINT actor_stat_cat_entry_owner_fkey FOREIGN KEY (owner) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
 
 ALTER TABLE actor.stat_cat_entry_user_map ADD CONSTRAINT actor_sc_tu_fkey FOREIGN KEY (target_usr) REFERENCES actor.usr (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE actor.stat_cat_entry_user_map ADD CONSTRAINT actor_sc_sue_fkey FOREIGN KEY (stat_cat_entry) REFERENCES asset.stat_cat_entry (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE actor.stat_cat_entry_user_map ADD CONSTRAINT actor_sc_sue_fkey FOREIGN KEY (stat_cat_entry) REFERENCES actor.stat_cat_entry (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
 
 
 ALTER TABLE actor.org_unit ADD CONSTRAINT actor_org_unit_mailing_address_fkey FOREIGN KEY (mailing_address) REFERENCES actor.org_address (id) DEFERRABLE INITIALLY DEFERRED;