Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
only save the position when saving state
Browse files Browse the repository at this point in the history
Before this change the entire Set object was serialized. Nothing but the
position in the migration list was actually read out in the load method.
This change will make it more obvious what you have to persist if you
provide your own State implementation.
  • Loading branch information
gustav-olsen-groupone committed Aug 5, 2015
1 parent 342c0d5 commit 0c74d2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ Set.prototype.addMigration = function(title, up, down){

Set.prototype.save = function(fn){
var self = this;
this.state.save(this, function (err) {
this.state.save({
pos: self.pos
}, function (err) {
self.emit('save');
fn(err);
});
Expand Down

0 comments on commit 0c74d2f

Please sign in to comment.