mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
Do not have multiple migration calls completing same callback
This commit is contained in:
parent
fc5abb2952
commit
8c0410c5e8
@ -41,8 +41,10 @@ function removeStrategySQL (strategy) {
|
|||||||
|
|
||||||
exports.up = function (db, callback) {
|
exports.up = function (db, callback) {
|
||||||
const insertStrategies = strategies.map((s) => (cb) => {
|
const insertStrategies = strategies.map((s) => (cb) => {
|
||||||
db.runSql(insertEventsSQL(s), cb);
|
async.series([
|
||||||
db.runSql(insertStrategySQL(s), cb);
|
db.runSql.bind(db, insertEventsSQL(s)),
|
||||||
|
db.runSql.bind(db, insertStrategySQL(s)),
|
||||||
|
], cb);
|
||||||
});
|
});
|
||||||
async.series(insertStrategies, callback);
|
async.series(insertStrategies, callback);
|
||||||
};
|
};
|
||||||
@ -51,8 +53,10 @@ exports.down = function (db, callback) {
|
|||||||
const removeStrategies = strategies
|
const removeStrategies = strategies
|
||||||
.filter(s => s.name !== 'default')
|
.filter(s => s.name !== 'default')
|
||||||
.map((s) => (cb) => {
|
.map((s) => (cb) => {
|
||||||
db.runSql(removeEventsSQL(s), cb);
|
async.series([
|
||||||
db.runSql(removeStrategySQL(s), cb);
|
db.runSql.bind(db, removeEventsSQL(s)),
|
||||||
|
db.runSql.bind(db, removeStrategySQL(s)),
|
||||||
|
], cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
async.series(removeStrategies, callback);
|
async.series(removeStrategies, callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user