mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
bae0de6cd5
* 🎨 knex-migrator reset [ci skip] * ✨ add migration example - hooks - 1.0 [ci skip] * 🛠 knex-migrator tarball - remove when released [ci skip] * 🎨 jscs/jshint * 🕵🏻 do not drop the database connection when running tests - please read the comments in the commit * 🔥 remove example migration * 🛠 knex-migrator 0.1.0 * 🛠 knex-migrator 0.1.1 - fix a single test to ensure we catch the error * 🛠 knex-migrator 0.1.2 * 🎨 make tests green - added my keyword: kate-migrations - i will go over all TODO's when removing the old migrations code * 🛠 knex-migrator update * 🛠 knex-migrator 0.2.0
20 lines
772 B
JavaScript
20 lines
772 B
JavaScript
var Promise = require('bluebird'),
|
|
_ = require('lodash'),
|
|
fixtures = require('../../schema/fixtures'),
|
|
logging = require('../../../logging');
|
|
|
|
module.exports = function insertFixtures(options) {
|
|
var localOptions = _.merge({
|
|
context: {internal: true}
|
|
}, options);
|
|
|
|
return Promise.mapSeries(fixtures.models, function (model) {
|
|
logging.info('Model: ' + model.name);
|
|
return fixtures.utils.addFixturesForModel(model, localOptions);
|
|
}).then(function () {
|
|
return Promise.mapSeries(fixtures.relations, function (relation) {
|
|
logging.info('Relation: ' + relation.from.model + ' to ' + relation.to.model);
|
|
return fixtures.utils.addFixturesForRelation(relation, localOptions);
|
|
});
|
|
});
|
|
};
|