2019-04-08 13:01:22 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-20 22:02:45 +00:00
|
|
|
function sync(db) {
|
2019-04-08 13:01:22 +00:00
|
|
|
var keys = Object.keys(db);
|
|
|
|
|
|
|
|
function next() {
|
|
|
|
var modelName = keys.shift();
|
|
|
|
if (!modelName) { return; }
|
2019-05-10 15:54:55 +00:00
|
|
|
return db[modelName].sync().then(next);
|
2019-04-08 13:01:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return Promise.resolve().then(next);
|
|
|
|
}
|
|
|
|
|
2019-04-20 22:02:45 +00:00
|
|
|
module.exports = sync;
|