Fix MS SQL N'' default values.

MS SQL apparently sends default values as Nvarchar, and in this case it
means we have to deal ourselves with the N'' representation of it.
This commit is contained in:
Dimitri Fontaine 2017-02-25 16:14:26 +01:00
parent 57bc1ca886
commit 2f7169e286

View File

@ -128,6 +128,11 @@
(cond ((and (null default) (column-nullable pgcol)) :null)
((and (stringp default) (string= "NULL" default)) :null)
;; fix stupid N'' behavior from MS SQL column default
((and (stringp default)
(uiop:string-enclosed-p "N'" default "'"))
(subseq default 2 (+ (length default) -1)))
((and (stringp default)
;; address CURRENT_TIMESTAMP(6) and other spellings
(or (uiop:string-prefix-p "CURRENT_TIMESTAMP" default)