File tree 2 files changed +22
-1
lines changed 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,8 @@ aInc == 1 && /PRIMARY KEY|primary key/ { next }
183
183
# BEGIN
184
184
# UPDATE Package SET LastUpdate = CURRENT_TIMESTAMP WHERE ActionId = old.ActionId;
185
185
# END
186
- gsub ( /ON UPDATE CURRENT_TIMESTAMP| on update current_timestamp /, " " )
186
+ gsub ( /(ON| on) (UPDATE| update) (CURRENT_TIMESTAMP| current_timestamp)(\(\) )? /, " " )
187
+ gsub ( /(DEFAULT| default) (CURRENT_TIMESTAMP| current_timestamp)(\(\) )? /, " DEFAULT current_timestamp" )
187
188
gsub ( /(COLLATE| collate) [^ ]+ /, " " )
188
189
gsub ( /(ENUM| enum)[^ )]+ \) /, " text " )
189
190
gsub ( /(SET| set)\( [^ )]+ \) /, " text " )
Original file line number Diff line number Diff line change @@ -101,5 +101,25 @@ cat <<\SQL
101
101
PARTITION p7 VALUES LESS THAN (2013) ENGINE = InnoDB)
102
102
SQL
103
103
104
+ cat << \SQLin
105
+ CREATE TABLE ` CCC` (
106
+ ` created` datetime DEFAULT current_timestamp(),
107
+ ` updated` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
108
+ );
109
+ SQLin
110
+
111
+ cat << \SQLout
112
+ PRAGMA synchronous = OFF;
113
+ PRAGMA journal_mode = MEMORY;
114
+ BEGIN TRANSACTION;
115
+ CREATE TABLE ` CCC` (
116
+ ` created` datetime DEFAULT current_timestamp
117
+ , ` updated` datetime DEFAULT current_timestamp
118
+ );
119
+ END TRANSACTION;
120
+ SQLout
121
+
122
+
104
123
cat << \SQL
105
124
SQL
125
+
You can’t perform that action at this time.
0 commit comments