From: Galen Charlton Date: Thu, 5 Nov 2015 15:44:43 +0000 (+0000) Subject: LP#1464765: stamp upgrade script X-Git-Tag: sprint4-merge-nov22~867 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7ca6e9952fef14ca50b0f57d8efe45b312fdaad8;p=working%2FEvergreen.git LP#1464765: stamp upgrade script Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index b0739fb061..ab7b39f88b 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0946', :eg_version); -- gmcharlt/berick +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0947', :eg_version); -- jboyer/gmcharlt CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0947.function.lpad_number_fix.sql b/Open-ILS/src/sql/Pg/upgrade/0947.function.lpad_number_fix.sql new file mode 100644 index 0000000000..8293eec18b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0947.function.lpad_number_fix.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0947', :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 + + $string =~ s/([0-9]+)/$pad x ($len - length($1)) . $1/eg; + + return $string; +$$ LANGUAGE PLPERLU; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.lpad_number_fix.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.lpad_number_fix.sql deleted file mode 100644 index 3b31f94f94..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.lpad_number_fix.sql +++ /dev/null @@ -1,15 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :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 - - $string =~ s/([0-9]+)/$pad x ($len - length($1)) . $1/eg; - - return $string; -$$ LANGUAGE PLPERLU; - -COMMIT;