From 7ec75211c160d6905238a35cf5eb34adb02d02e8 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 9 Apr 2009 15:35:26 +0000 Subject: [PATCH] A long time ago, miker said we could correct typos in the schema as long as we add corresponding upgrade logic Let's take advantage of his openness before we hit 2.0 :) git-svn-id: svn://svn.open-ils.org/ILS/trunk@12829 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/040.schema.asset.sql | 6 +++--- Open-ILS/src/sql/Pg/1.4-2.0-upgrade-db.sql | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/1.4-2.0-upgrade-db.sql diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index b8749a51f7..16cd91edc1 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -84,12 +84,12 @@ CREATE TABLE asset.copy_transparency ( CONSTRAINT scte_name_once_per_lib UNIQUE (owner,name) ); -CREATE TABLE asset.copy_tranparency_map ( +CREATE TABLE asset.copy_transparency_map ( id BIGSERIAL PRIMARY KEY, - tansparency INT NOT NULL REFERENCES asset.copy_transparency (id) DEFERRABLE INITIALLY DEFERRED, + transparency INT NOT NULL REFERENCES asset.copy_transparency (id) DEFERRABLE INITIALLY DEFERRED, target_copy INT NOT NULL UNIQUE REFERENCES asset.copy (id) DEFERRABLE INITIALLY DEFERRED ); -CREATE INDEX cp_tr_cp_idx ON asset.copy_tranparency_map (tansparency); +CREATE INDEX cp_tr_cp_idx ON asset.copy_transparency_map (transparency); CREATE TABLE asset.stat_cat_entry_transparency_map ( id BIGSERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/1.4-2.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.4-2.0-upgrade-db.sql new file mode 100644 index 0000000000..f62b04e3f2 --- /dev/null +++ b/Open-ILS/src/sql/Pg/1.4-2.0-upgrade-db.sql @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 Equinox Software, Inc. + * Mike Rylander + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +BEGIN; + +------------------ +/* Typos begone */ +------------------ + +DROP INDEX asset.cp_tr_cp_idx; +ALTER TABLE asset.copy_tranparency_map RENAME COLUMN tansparency TO transparency; +ALTER TABLE asset.copy_tranparency_map RENAME TO copy_transparency_map; +CREATE INDEX cp_tr_cp_idx ON asset.copy_transparency_map (transparency); + +COMMIT; -- 2.11.0