From 320a54553372fa9ba50f56bcd47172630d0e8c33 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 18 Dec 2016 19:19:25 +0100 Subject: [PATCH] Fix SQL types creation: consider views too. When migrating views from e.g. MySQL it is necessary to consider the user defined SQL types (ENUMs) those views might be using. --- src/pgsql/pgsql-create-schema.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pgsql/pgsql-create-schema.lisp b/src/pgsql/pgsql-create-schema.lisp index 9b20cba..b712952 100644 --- a/src/pgsql/pgsql-create-schema.lisp +++ b/src/pgsql/pgsql-create-schema.lisp @@ -15,7 +15,8 @@ "Create the needed data types for given CATALOG." (let ((sqltype-list)) ;; build the sqltype list - (loop :for table :in (table-list catalog) + (loop :for table :in (append (table-list catalog) + (view-list catalog)) :do (loop :for column :in (table-column-list table) :do (when (typep (column-type-name column) 'sqltype) (pushnew (column-type-name column) sqltype-list