larvitdbmigration
Advanced tools
Comparing version 2.0.3 to 2.0.4
'use strict'; | ||
const topLogPrefix = 'larvitdbmigration: dbType/elasticsearch.js - ', | ||
const topLogPrefix = 'larvitdbmigration: dbType/elasticsearch.js: ', | ||
request = require('request'), | ||
@@ -284,4 +284,5 @@ async = require('async'), | ||
cb(scriptErr); | ||
return cb(scriptErr); | ||
}); | ||
return; | ||
} | ||
@@ -306,3 +307,3 @@ | ||
} else { | ||
cb(); | ||
return cb(); | ||
} | ||
@@ -313,6 +314,6 @@ }); | ||
log.error(logPrefix + 'Uncaught error: ' + err.message); | ||
cb(err); | ||
return cb(err); | ||
} | ||
} else { | ||
cb(); | ||
return cb(); | ||
} | ||
@@ -319,0 +320,0 @@ }); |
'use strict'; | ||
const topLogPrefix = 'larvitdbmigration: dbType/larvitdb.js - ', | ||
const topLogPrefix = 'larvitdbmigration: dbType/larvitdb.js: ', | ||
async = require('async'), | ||
@@ -5,0 +5,0 @@ mysql = require('mysql2'), |
@@ -11,3 +11,4 @@ { | ||
"async": "^2.0.1", | ||
"elasticsearch": "^12.1.3", | ||
"elasticsearch": "^13.0.0", | ||
"json-stringify-safe": "^5.0.1", | ||
"larvitdb": "^1.2.2", | ||
@@ -39,3 +40,3 @@ "larvitutils": "^1.1.1", | ||
}, | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"readmeFilename": "README.md", | ||
@@ -42,0 +43,0 @@ "scripts": { |
@@ -20,8 +20,2 @@ 'use strict'; | ||
log.remove(log.transports.Console); | ||
log.add(log.transports.Console, { | ||
'level': 'warn', | ||
'colorize': true, | ||
'timestamp': true, | ||
'json': false | ||
}); | ||
@@ -221,2 +215,30 @@ before(function (done) { | ||
}); | ||
it('Should fail when migration returns error', function (done) { | ||
const tasks = []; | ||
// Clean out database | ||
tasks.push(function (cb) { | ||
db.removeAllTables(cb); | ||
}); | ||
// Run failing migrations | ||
tasks.push(function (cb) { | ||
let dbMigrations; | ||
mariaDbConf.migrationScriptsPath = path.join(__dirname, '../testmigrations_mariadb_failing'); | ||
mariaDbConf.dbType = 'larvitdb'; | ||
mariaDbConf.dbDriver = db; | ||
dbMigrations = new DbMigration(mariaDbConf); | ||
dbMigrations.run(function (err) { | ||
assert(err instanceof Error, 'err should be an instance of Error'); | ||
cb(); | ||
}); | ||
}); | ||
async.series(tasks, done); | ||
}); | ||
}); | ||
@@ -223,0 +245,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33551
19
817
9
+ Addedjson-stringify-safe@^5.0.1
+ Addedagentkeepalive@2.2.0(transitive)
+ Addedelasticsearch@13.3.1(transitive)
+ Addedlodash@2.4.2(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addedlodash.isempty@4.4.0(transitive)
+ Addedlodash.trimend@4.5.1(transitive)
- Removedasap@2.0.6(transitive)
- Removedelasticsearch@12.1.3(transitive)
- Removedpromise@7.3.1(transitive)
Updatedelasticsearch@^13.0.0