Remove -i flag from Rails3 pg_dump invocation.
authorTom Clegg <tom@curoverse.com>
Fri, 24 Mar 2017 18:37:22 +0000 (14:37 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 24 Mar 2017 18:41:59 +0000 (14:41 -0400)
No issue #

services/api/Rakefile

index fbbf53e3c6ac3d1c247b556db29f2f23141c4285..6df88c308c2c5945472db88de5f2b8f4c1385841 100644 (file)
@@ -63,3 +63,14 @@ namespace :db do
     end
   end
 end
+
+# Work around Rails3+PostgreSQL9.5 incompatibility (pg_dump used to
+# accept -i as a no-op, but now it's not accepted at all).
+module Kernel
+  alias_method :orig_backtick, :`
+  def `(*args) #`#` sorry, parsers
+    args[0].sub!(/\Apg_dump -i /, 'pg_dump ') rescue nil
+    STDERR.puts "`#{args.inspect}`"
+    orig_backtick(*args)
+  end
+end