Skip to content

Commit

Permalink
0000733: dbexport should use the default schema and default catalog i…
Browse files Browse the repository at this point in the history
…f they aren't specified
  • Loading branch information
chenson42 committed Jul 26, 2012
1 parent e1d376b commit 46e09f7
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -32,6 +32,7 @@

import javax.sql.DataSource;

import org.apache.commons.lang.StringUtils;
import org.jumpmind.db.io.DatabaseIO;
import org.jumpmind.db.model.Column;
import org.jumpmind.db.model.Database;
Expand Down Expand Up @@ -147,6 +148,14 @@ public void exportTables(OutputStream output, Table[] tables, String sql) throws
final Writer writer = new OutputStreamWriter(output);
final CsvWriter csvWriter = new CsvWriter(writer, ',');

if (StringUtils.isBlank(schema)) {
schema = platform.getDefaultSchema();
}

if (StringUtils.isBlank(catalog)) {
catalog = platform.getDefaultCatalog();
}

tables = Database.sortByForeignKeys(tables);

IDdlBuilder target = DdlBuilderFactory.createDdlBuilder(compatible.toString().toLowerCase());
Expand Down

0 comments on commit 46e09f7

Please sign in to comment.