Fix default value handling in MS SQL.

When the column is known to be non-nullable, refrain from adding a null
default value to it. This also fixes the case of casting from an

  [int] IDENTITY(1,1) NOT NULL

That otherwise did get transformed into a

  bigserial not null default NULL

Causing then the error

  Database error 42601: multiple default values specified for column ... of table ...
This commit is contained in:
Dimitri Fontaine 2017-01-23 21:50:16 +01:00
parent c0f9569ddd
commit bd84c6fec9

View File

@ -124,7 +124,7 @@
;; normalize default values
;; see *pgsql-default-values*
(setf (column-default pgcol)
(cond ((null default) :null)
(cond ((and (null default) (column-nullable pgcol)) :null)
((and (stringp default) (string= "NULL" default)) :null)
((and (stringp default)