From: Jacob Coby Date: Fri, 26 Mar 2010 17:35:43 +0000 (-0400) Subject: default 0000-00-00 00:00:00 datetime columns to 'epoch' X-Git-Url: http://git.neszt.hu/?a=commitdiff_plain;h=6b3529aa1396a1f5655a7616c0c711c8561cdfee;p=mysql2postgres default 0000-00-00 00:00:00 datetime columns to 'epoch' --- diff --git a/mysql2psql b/mysql2psql index 8f69b1a..a161ee3 100755 --- a/mysql2psql +++ b/mysql2psql @@ -385,6 +385,10 @@ EOF if column[:type] == "char" row[index] = row[index] == 1 ? 't' : row[index] == 0 ? 'f' : row[index] end + # give a default for zeroed datetimes + if column[:type] == "datetime" and row[index] == '0000-00-00 00:00:00' + row[index] = 'epoch' + end if row[index].is_a?(String) if column[:type] == "bytea" row[index] = PGconn.quote(row[index])