CREATE TABLE authority.rec_descriptor (
id BIGSERIAL PRIMARY KEY,
record BIGINT,
- record_status "char",
- char_encoding "char"
+ record_status TEXT,
+ char_encoding TEXT
);
CREATE INDEX authority_rec_descriptor_record_idx ON authority.rec_descriptor (record);
id BIGSERIAL PRIMARY KEY,
record BIGINT NOT NULL,
tag CHAR(3) NOT NULL,
- ind1 "char",
- ind2 "char",
- subfield "char",
+ ind1 TEXT,
+ ind2 TEXT,
+ subfield TEXT,
value TEXT NOT NULL,
index_vector tsvector NOT NULL
);
CREATE INDEX authority_full_rec_index_vector_idx ON authority.full_rec USING GIST (index_vector);
+CREATE OR REPLACE VIEW authority.tracing_links AS
+ SELECT main.record AS record,
+ main.id AS main_id,
+ main.tag AS main_tag,
+ main.value AS main_value,
+ substr(link.value,1,1) AS relationship,
+ substr(link.value,2,1) AS use_restriction,
+ substr(link.value,3,1) AS deprecation,
+ substr(link.value,4,1) AS display_restriction,
+ link_value.id AS link_id,
+ link_value.tag AS link_tag,
+ link_value.value AS link_value
+ FROM authority.full_rec main
+ JOIN authority.full_rec link
+ ON ( link.record = main.record
+ AND link.tag in ((main.tag::int + 400)::text, (main.tag::int + 300)::text)
+ AND link.subfield = 'w' )
+ JOIN authority.full_rec link_value
+ ON ( link_value.record = main.record
+ AND link_value.tag = link.tag
+ AND link_value.subfield = 'a' )
+ WHERE main.tag IN ('100','110','111','130','150','151','155','180','181','182','185')
+ AND main.subfield = 'a';
+
+
COMMIT;
selection_ou INT NOT NULL,
selection_depth INT NOT NULL DEFAULT 0,
pickup_lib INT NOT NULL REFERENCES actor.org_unit,
- hold_type "char" NOT NULL CHECK (hold_type IN ('M','T','V','C')),
+ hold_type TEXT NOT NULL CHECK (hold_type IN ('M','T','V','C')),
holdable_formats TEXT,
phone_notify TEXT,
email_notify BOOL NOT NULL DEFAULT TRUE