From 5d488e258c2c007e332eda46be6263fb1efc2c3e Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 9 Aug 2010 14:37:20 +0000 Subject: [PATCH] And let's create those new auditor columns first, before any changes ripple through the base table git-svn-id: svn://svn.open-ils.org/ILS/trunk@17138 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/sql/Pg/upgrade/0364.schema.call_number_normalization.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/sql/Pg/upgrade/0364.schema.call_number_normalization.sql b/Open-ILS/src/sql/Pg/upgrade/0364.schema.call_number_normalization.sql index f2f10775ea..d68f801976 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0364.schema.call_number_normalization.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0364.schema.call_number_normalization.sql @@ -7,6 +7,7 @@ CREATE TABLE asset.call_number_class ( name TEXT NOT NULL, normalizer TEXT NOT NULL DEFAULT 'asset.normalize_generic' ); +CREATE INDEX asset_call_number_label_sortkey ON asset.call_number(label_sortkey); INSERT INTO asset.call_number_class (name, normalizer) VALUES ('Generic', 'asset.label_normalizer_generic'), @@ -14,11 +15,10 @@ INSERT INTO asset.call_number_class (name, normalizer) VALUES ('Library of Congress (LC)', 'asset.label_normalizer_lc') ; -ALTER TABLE asset.call_number ADD COLUMN label_class BIGINT DEFAULT 1 NOT NULL REFERENCES asset.call_number_class(id) DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE asset.call_number ADD COLUMN label_sortkey TEXT; -CREATE INDEX asset_call_number_label_sortkey ON asset.call_number(label_sortkey); ALTER TABLE auditor.asset_call_number_history ADD COLUMN label_class BIGINT; ALTER TABLE auditor.asset_call_number_history ADD COLUMN label_sortkey TEXT; +ALTER TABLE asset.call_number ADD COLUMN label_class BIGINT DEFAULT 1 NOT NULL REFERENCES asset.call_number_class(id) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE asset.call_number ADD COLUMN label_sortkey TEXT; CREATE OR REPLACE FUNCTION asset.label_normalizer() RETURNS TRIGGER AS $func$ DECLARE -- 2.11.0