From 049a1199c20a60feef62ce24919297d48746049c Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Tue, 8 Aug 2017 21:55:15 +0200 Subject: [PATCH] Implement support for SQLite current_date default value. The spelling in SQLite for the default value is "current_date", instruct pgloader about that. This commit also adds a test case in our sqlite.db unit tests database. Fixes #607. --- src/sources/sqlite/sqlite-cast-rules.lisp | 2 ++ test/sqlite/sqlite.db | Bin 98304 -> 102400 bytes 2 files changed, 2 insertions(+) diff --git a/src/sources/sqlite/sqlite-cast-rules.lisp b/src/sources/sqlite/sqlite-cast-rules.lisp index 34f7dc2..2160c66 100644 --- a/src/sources/sqlite/sqlite-cast-rules.lisp +++ b/src/sources/sqlite/sqlite-cast-rules.lisp @@ -100,6 +100,8 @@ (or (uiop:string-prefix-p "CURRENT_TIMESTAMP" default) (string= "CURRENT TIMESTAMP" default))) :current-timestamp) + ((and (stringp default) (string-equal "current_date" default)) + :current-date) (t (column-default pgcol)))) pgcol))) diff --git a/test/sqlite/sqlite.db b/test/sqlite/sqlite.db index f6433610772e49e4a9715900fa6c0dfdcd5de7d7..ac00c762eff725e65551bbac92cbdfc5f576d82f 100644 GIT binary patch delta 203 zcmZo@U~5>wHbGiYkAZQj~;^_s{=3hKL$b0X%n**nK-9yoXEjxS0l(S zuB^=1XkU_;l#`lVT2z#pSCW!gg3Oe34svx2aa9O$bn7RTFf`XSumBfHbGiYhk=1X0*GNie4>sqj}C+GGcI24e+&X#A``O}Hwy}Ma5jr@Z5QEU Hd{YVlK#vS3