mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
ES6 migration: server/data/migrations/versions/2.0
refs #9742 - use ES6
This commit is contained in:
parent
0a556f95c7
commit
ef355e281c
2 changed files with 10 additions and 4 deletions
|
@ -7,7 +7,7 @@ const common = require('../../../../lib/common'),
|
|||
message3 = `Renamed column ${columnNameOld} to ${columnNameNew}`,
|
||||
message4 = `Renamed column ${columnNameNew} to ${columnNameOld}`;
|
||||
|
||||
module.exports.up = function renameAmpColumn(options) {
|
||||
module.exports.up = (options) => {
|
||||
const connection = options.connection;
|
||||
|
||||
common.logging.info(message1);
|
||||
|
@ -25,7 +25,7 @@ module.exports.up = function renameAmpColumn(options) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.down = function renameCommentIdColumn(options) {
|
||||
module.exports.down = (options) => {
|
||||
let connection = options.connection;
|
||||
|
||||
common.logging.info(message2);
|
||||
|
|
|
@ -3,13 +3,14 @@ const _ = require('lodash'),
|
|||
common = require('../../../../lib/common'),
|
||||
models = require('../../../../models'),
|
||||
message1 = 'Updating post data (comment_id)',
|
||||
message2 = 'Updated post data (comment_id)';
|
||||
message2 = 'Updated post data (comment_id)',
|
||||
message3 = 'Nothing todo. Keep correct comment_id values in amp column.';
|
||||
|
||||
module.exports.config = {
|
||||
transaction: true
|
||||
};
|
||||
|
||||
module.exports.up = function updatePosts(options) {
|
||||
module.exports.up = (options) => {
|
||||
const postAllColumns = ['id', 'comment_id'];
|
||||
|
||||
let localOptions = _.merge({
|
||||
|
@ -34,3 +35,8 @@ module.exports.up = function updatePosts(options) {
|
|||
common.logging.info(message2);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.down = () => {
|
||||
common.logging.info(message3);
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue