Skip to content

Commit 3466970

Browse files
author
Drew Repasky
committed
handle varied letter casing of current_timestamp and optional parens
1 parent 3e05e81 commit 3466970

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mysql2sqlite

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ aInc == 1 && /PRIMARY KEY|primary key/ { next }
183183
# BEGIN
184184
# UPDATE Package SET LastUpdate = CURRENT_TIMESTAMP WHERE ActionId = old.ActionId;
185185
# END
186-
gsub( /ON UPDATE CURRENT_TIMESTAMP|on update current_timestamp/, "" )
186+
gsub( /ON UPDATE (CURRENT_TIMESTAMP|current_timestamp)(\(\))?/, "" )
187+
gsub( /(DEFAULT|default) (CURRENT_TIMESTAMP|current_timestamp)(\(\))?/, "DEFAULT current_timestamp")
187188
gsub( /(COLLATE|collate) [^ ]+ /, "" )
188189
gsub( /(ENUM|enum)[^)]+\)/, "text " )
189190
gsub( /(SET|set)\([^)]+\)/, "text " )

0 commit comments

Comments
 (0)