Skip to content

Commit

Permalink
Changed rollback messages
Browse files Browse the repository at this point in the history
refs #9742

- use logging.warn
- make sure it's understandable that we are rolling back
  • Loading branch information
kirrg001 committed Jul 22, 2018
1 parent a807f70 commit c7f73f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const common = require('../../../../lib/common'),
columnNameOld = 'amp',
columnNameNew = 'comment_id',
message1 = `Renaming column ${columnNameOld} to ${columnNameNew}`,
message2 = `Renaming column ${columnNameNew} to ${columnNameOld}`,
message2 = `Rollback: Renaming column ${columnNameNew} to ${columnNameOld}`,
message3 = `Renamed column ${columnNameOld} to ${columnNameNew}`,
message4 = `Renamed column ${columnNameNew} to ${columnNameOld}`;
message4 = `Rollback: Renamed column ${columnNameNew} to ${columnNameOld}`;

module.exports.up = (options) => {
const connection = options.connection;
Expand All @@ -28,7 +28,7 @@ module.exports.up = (options) => {
module.exports.down = (options) => {
let connection = options.connection;

common.logging.info(message2);
common.logging.warn(message2);

return connection.schema.hasColumn(table, columnNameNew)
.then((exists) => {
Expand All @@ -39,6 +39,6 @@ module.exports.down = (options) => {
}
})
.then(() => {
common.logging.info(message4);
common.logging.warn(message4);
});
};
4 changes: 2 additions & 2 deletions core/server/data/migrations/versions/2.0/2-update-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const _ = require('lodash'),
models = require('../../../../models'),
message1 = 'Updating post data (comment_id)',
message2 = 'Updated post data (comment_id)',
message3 = 'Nothing todo. Keep correct comment_id values in amp column.';
message3 = 'Rollback: Keep correct comment_id values in amp column.';

module.exports.config = {
transaction: true
Expand Down Expand Up @@ -37,6 +37,6 @@ module.exports.up = (options) => {
};

module.exports.down = () => {
common.logging.info(message3);
common.logging.warn(message3);
return Promise.resolve();
};

0 comments on commit c7f73f4

Please sign in to comment.