From: Galen Charlton Date: Mon, 2 Mar 2015 14:56:34 +0000 (+0000) Subject: LP#1155313: fix mangling of schema upgrade script name X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6c52b6ed021adcf43e9ef7b7152c1245ef263585;p=evergreen%2Fmasslnc.git LP#1155313: fix mangling of schema upgrade script name Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/upgrade/0914.schema.lpad-number-repair.sql b/Open-ILS/src/sql/Pg/upgrade/0914.schema.lpad-number-repair.sql new file mode 100644 index 0000000000..2d2d1f7696 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0914.schema.lpad-number-repair.sql @@ -0,0 +1,25 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0914', :eg_version); + +CREATE OR REPLACE FUNCTION evergreen.lpad_number_substrings( TEXT, TEXT, INT ) RETURNS TEXT AS $$ + my $string = shift; # Source string + my $pad = shift; # string to fill. Typically '0'. This should be a single character. + my $len = shift; # length of resultant padded field + my $find = $len - 1; + + while ($string =~ /(^|\D)(\d{1,$find})($|\D)/) { + my $padded = $2; + $padded = $pad x ($len - length($padded)) . $padded; + $string = $` . $1 . $padded . $3 . $'; + } + + return $string; +$$ LANGUAGE PLPERLU; + +COMMIT; + +-- recompute the various normalized label fields that use lpad_number_substrings() +UPDATE biblio.monograph_part SET id = id; +UPDATE asset.call_number_prefix SET id = id; +UPDATE asset.call_number_suffix SET id = id; diff --git a/Open-ILS/src/sql/Pg/upgrade/0914.schema.redo_vandelay_merge_profile_sequence.sql b/Open-ILS/src/sql/Pg/upgrade/0914.schema.redo_vandelay_merge_profile_sequence.sql deleted file mode 100644 index 2d2d1f7696..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/0914.schema.redo_vandelay_merge_profile_sequence.sql +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('0914', :eg_version); - -CREATE OR REPLACE FUNCTION evergreen.lpad_number_substrings( TEXT, TEXT, INT ) RETURNS TEXT AS $$ - my $string = shift; # Source string - my $pad = shift; # string to fill. Typically '0'. This should be a single character. - my $len = shift; # length of resultant padded field - my $find = $len - 1; - - while ($string =~ /(^|\D)(\d{1,$find})($|\D)/) { - my $padded = $2; - $padded = $pad x ($len - length($padded)) . $padded; - $string = $` . $1 . $padded . $3 . $'; - } - - return $string; -$$ LANGUAGE PLPERLU; - -COMMIT; - --- recompute the various normalized label fields that use lpad_number_substrings() -UPDATE biblio.monograph_part SET id = id; -UPDATE asset.call_number_prefix SET id = id; -UPDATE asset.call_number_suffix SET id = id;