square/sq-dbsync — pull request #5 by smparkes (2013-04-17 03:15:51+00:00)
Title: Handle postgres 'with tz' in files and cleanup

@xaviershay @da3mon @simoleone @bryanduxbury

- Drop the +XX in postgres 'with time zone' columns
- remove a jruby-incompatible spec
- reminder/note that specs will fail under jruby if you don't have your
mysql server character set set to utf8mb4

'with time zone' pg fields have to be selected as "column-name"::timestamp or they end up with a +XX tz offset on them which mysql barfs on ... sometimes? Go figure. In any case, relying on msyql to ignore the tz is bad idea even if it sometimes does.

The easiest way I could figure to get the data flow to work is to maintain the source db type in the schema record and to patch the sql before executing it. Since we're using Sequel to do a lot of the heavy lifting, there aren't too many places to hook in.

If someone has a better idea how to do this, I'm open to it.