DEV: Less verbose remapping

DEV: Less verbose remapping

It’s hard to see which columns have been remapped when remapping prints lots of “0 rows affected” lines. This changes it to output the row count only for affected columns.

diff --git a/lib/remap.rb b/lib/remap.rb
index d6439fd..b49cd7b 100644
--- a/lib/remap.rb
+++ b/lib/remap.rb
@@ -49,7 +49,7 @@ WHERE table_schema='public' and (data_type like 'char%' or data_type like 'text%
             AND #{column_name} <> replace(#{column_name}, $1, $2)", [@from, @to])
       end
 
-      log "#{result.cmd_tuples} rows affected!"
+      log "#{result.cmd_tuples} rows affected!" if result.cmd_tuples > 0
     end
 
     Theme.expire_site_cache!

GitHub sha: 5ffb7229

1 Like