mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Fix formating of default values in MySQL cast rules.
This commit is contained in:
parent
cefd19d704
commit
a6c5bc9811
@ -184,15 +184,17 @@
|
||||
(or (null ai-s-p) (eq auto-increment rule-source-auto-increment)))
|
||||
(list :using using :target rule-target))))))
|
||||
|
||||
(defun format-pgsql-default-value (default using-cast-fn)
|
||||
(defun format-pgsql-default-value (default &optional using-cast-fn)
|
||||
"Returns suitably quoted default value for CREATE TABLE command."
|
||||
(cond
|
||||
((null default) "NULL")
|
||||
((string= "NULL" default) default)
|
||||
((string= "CURRENT_TIMESTAMP" default) default)
|
||||
(t
|
||||
(format nil "'~a'"
|
||||
;; apply the transformation function to the default value
|
||||
(if using-cast-fn (funcall using-cast-fn default) default)))))
|
||||
;; apply the transformation function to the default value
|
||||
(if using-cast-fn (format-pgsql-default-value
|
||||
(funcall using-cast-fn default))
|
||||
(format nil "'~a'" default)))))
|
||||
|
||||
(defun format-pgsql-type (source target using)
|
||||
"Returns a string suitable for a PostgreSQL type definition"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user