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')]$$ );
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,
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;