Fix support for discovery of DBF target table name.

When the LOAD command does not provide the name of the target table for a
DBF source, we can get the name of the table from the DBF file itself. That
feature got broken, here's a fix.

Fix #805.
This commit is contained in:
Dimitri Fontaine 2018-06-01 11:20:45 -04:00
parent 4cd26c09fd
commit dfedce2aba
2 changed files with 4 additions and 3 deletions

View File

@ -107,7 +107,8 @@
:target-db ,pg-db-conn
:encoding ,encoding
:source-db source-db
:target (create-table ',target-table-name))))
:target ,(when target-table-name
(create-table target-table-name)))))
,(sql-code-block pg-db-conn :pre before "before load")

View File

@ -51,8 +51,8 @@
(declare (ignore materialize-views only-tables create-indexes foreign-keys
including excluding))
(let* ((table (or (target db3) (source db3)))
(schema (or (when (table-schema (target db3))
(push-to-end (table-schema (target db3))
(schema (or (when (table-schema table)
(push-to-end (table-schema table)
(catalog-schema-list catalog)))
(add-schema catalog (table-name table)))))
(push-to-end table (schema-table-list schema))