install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0154'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0155'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
SELECT regexp_replace(regexp_replace(regexp_replace($1, E'\\n', ' ', 'g'), E'(?:^\\s+)|(\\s+$)', '', 'g'), E'\\s+', ' ', 'g');
$$ LANGUAGE SQL;
+CREATE OR REPLACE FUNCTION public.remove_commas( TEXT ) RETURNS TEXT AS $$
+ SELECT regexp_replace($1, ',', '', 'g');
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.remove_whitespace( TEXT ) RETURNS TEXT AS $$
+ SELECT regexp_replace(normalize_space($1), E'\\s+', '', 'g');
+$$ LANGUAGE SQL;
+
CREATE OR REPLACE FUNCTION public.lowercase( TEXT ) RETURNS TEXT AS $$
return lc(shift);
$$ LANGUAGE PLPERLU;
--- /dev/null
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0155'); -- miker
+
+CREATE OR REPLACE FUNCTION public.remove_commas( TEXT ) RETURNS TEXT AS $$
+ SELECT regexp_replace($1, ',', '', 'g');
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.remove_whitespace( TEXT ) RETURNS TEXT AS $$
+ SELECT regexp_replace(normalize_space($1), E'\\s+', '', 'g');
+$$ LANGUAGE SQL;
+
+COMMIT;