Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ var validate = function(cb) {
if(!_steps[dbStep.id] || (dbStep.order && dbStep.order != _steps[dbStep.id].order)){
this.steps[index].status = statuses.error;
cb("[" + dbStep.id + "] was already migrated on [" + dbStep.date + "] in a different order. Database order[" + dbStep.order + "] - Current migration on this order[" + this.steps[index].id + "]");
}else if(dbStep.checksum != this.steps[index].checksum){
this.steps[index].status = statuses.error;
cb("[" + dbStep.id + "] was already migrated on [" + dbStep.date + "] in a different version. Database version[" + dbStep.checksum + "] - Current version[" + this.steps[index].checksum + "]");
}
// else if(dbStep.checksum != this.steps[index].checksum){
// this.steps[index].status = statuses.error;
// cb("[" + dbStep.id + "] was already migrated on [" + dbStep.date + "] in a different version. Database version[" + dbStep.checksum + "] - Current version[" + this.steps[index].checksum + "]");
// }
}
}.bind(this));

Expand Down Expand Up @@ -174,4 +175,4 @@ Migration.prototype.migrate = function(doneCb) {
}.bind(this));
};

module.exports = Migration;
module.exports = Migration;
3 changes: 2 additions & 1 deletion src/steps/step-file-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function StepFile(path){

StepFile.prototype.read = function(){
this.content = fs.readFileSync(this.path, {encoding : 'utf8'});
this.content = this.content.replace(/[\r]/g, '');
this.checksum = md5(this.content);

return this;
Expand All @@ -27,4 +28,4 @@ StepFile.prototype.getStep = function(){
return new Step(merge(obj, {checksum : this.checksum}));
}

module.exports = StepFile;
module.exports = StepFile;