let's strip commas as well with attempt_money
authorJason Etheridge <jason@esilibrary.com>
Wed, 14 Jan 2015 21:58:44 +0000 (21:58 +0000)
committerJason Etheridge <jason@esilibrary.com>
Wed, 14 Jan 2015 21:58:44 +0000 (21:58 +0000)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>

sql/base/base.sql

index b828102..c61f758 100644 (file)
@@ -688,7 +688,7 @@ CREATE OR REPLACE FUNCTION migration_tools.attempt_money (TEXT,TEXT) RETURNS NUM
         output NUMERIC(8,2);
     BEGIN
         FOR output IN
-            EXECUTE 'SELECT ' || quote_literal(REPLACE(attempt_value,'$','')) || '::NUMERIC(8,2) AS a;'
+            EXECUTE 'SELECT ' || quote_literal(REPLACE(REPLACE(attempt_value,'$',''),',','')) || '::NUMERIC(8,2) AS a;'
         LOOP
             RETURN output;
         END LOOP;
@@ -709,7 +709,7 @@ CREATE OR REPLACE FUNCTION migration_tools.attempt_money6 (TEXT,TEXT) RETURNS NU
         output NUMERIC(6,2);
     BEGIN
         FOR output IN
-            EXECUTE 'SELECT ' || quote_literal(REPLACE(attempt_value,'$','')) || '::NUMERIC(6,2) AS a;'
+            EXECUTE 'SELECT ' || quote_literal(REPLACE(REPLACE(attempt_value,'$',''),',','')) || '::NUMERIC(6,2) AS a;'
         LOOP
             RETURN output;
         END LOOP;