This commit is contained in:
Jan Prochazka
2020-09-27 08:28:59 +02:00
parent 5fa36c40f2
commit 154a4fc7d9
4 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
const { prepareTableForImport } = require('@dbgate/tools');
const _ = require('lodash');
/**
@@ -34,7 +35,7 @@ function createBulkInsertStream(driver, mssql, stream, pool, name, options) {
if (options.createIfNotExists && (!structure || options.dropIfExists)) {
console.log(`Creating table ${fullName}`);
const dmp = driver.createDumper();
dmp.createTable({ ...writable.structure, ...name });
dmp.createTable(prepareTableForImport({ ...writable.structure, ...name }));
console.log(dmp.s);
await driver.query(pool, dmp.s);
structure = await driver.analyseSingleTable(pool, name);