projects
/
mysql2postgres
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11c470d
)
default 0000-00-00 00:00:00 datetime columns to 'epoch'
author
Jacob Coby
<jcoby@portallabs.com>
Fri, 26 Mar 2010 17:35:43 +0000
(13:35 -0400)
committer
Jacob Coby
<jcoby@portallabs.com>
Fri, 26 Mar 2010 17:35:43 +0000
(13:35 -0400)
mysql2psql
patch
|
blob
|
history
diff --git
a/mysql2psql
b/mysql2psql
index
8f69b1a
..
a161ee3
100755
(executable)
--- 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])