0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/data/migration/fixtures/update.js
Katharina Irrgang 6e1bd2838e improvement: migrations (#7000)
closes #6972, #6574

- run each database version as top level transaction
- run migrations in correct order
2016-07-14 11:59:42 +01:00

23 lines
622 B
JavaScript

// # Update Fixtures
// This module handles updating fixtures.
// This is done manually, through a series of files stored in an adjacent folder
// E.g. if we update to version 004, all the tasks in /004/ are executed
var Promise = require('bluebird'),
sequence = require('../../../utils/sequence'),
update;
/**
* Handles doing subsequent update for one version
*/
update = function update(tasks, logger, modelOptions) {
logger.info('Running fixture updates');
if (!tasks.length) {
return Promise.resolve();
}
return sequence(tasks, modelOptions, logger);
};
module.exports = update;