From 3101960af6d13eb44c12dfb1ca2381fd16136f0a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 31 May 2019 13:32:19 -0400 Subject: MySQL forces NOT NULL TIMESTAMPs to have default values --- src/cjr_print.sml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/cjr_print.sml') diff --git a/src/cjr_print.sml b/src/cjr_print.sml index b9795194..5dcfbe89 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -3791,7 +3791,13 @@ fun p_sql env (ds, _) = string ts, case t of Nullable _ => box [] - | _ => string " NOT NULL"] + | _ => string " NOT NULL", + case t of + Time => if #requiresTimestampDefaults (Settings.currentDbms ()) then + string " DEFAULT CURRENT_TIMESTAMP" + else + box [] + | _ => box []] end) xts, case (pk, csts) of ("", []) => box [] -- cgit v1.2.3