From 446df213bdd13bb3074c34b47960072f4f3427ff Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 6 Oct 2013 18:09:49 +0200 Subject: [PATCH] Filter out VIEWS from the current MySQL migration processing. --- mysql.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mysql.lisp b/mysql.lisp index 40ce38d..62f35d2 100644 --- a/mysql.lisp +++ b/mysql.lisp @@ -53,11 +53,13 @@ for (table-name . coldef) in (caar (cl-mysql:query (format nil " - select table_name, column_name, - data_type, column_type, column_default, - is_nullable, extra - from information_schema.columns - where table_schema = '~a' ~@[and table_name in (~{'~a'~^,~})~] + select c.table_name, c.column_name, + c.data_type, c.column_type, c.column_default, + c.is_nullable, c.extra + from information_schema.columns c + join information_schema.tables t using(table_schema, table_name) + where c.table_schema = '~a' and t.table_type = 'BASE TABLE' + ~@[and table_name in (~{'~a'~^,~})~] order by table_name, ordinal_position" dbname only-tables))) do (let ((entry (assoc table-name schema :test 'equal)))