migrating-ravens / RavenMigrations

A small migrations framework to help you manage your RavenDB Instance.
MIT License
53 stars 24 forks source link

Allow migrations to produce additional commands #28

Closed smerrell closed 9 years ago

smerrell commented 9 years ago

Alter.Collection can be used now to add additional ICommandData to the Alter.Collection batch. This makes it so you can safely add new documents or make changes to additional documents and have it be part of the same batch / transaction.

This changes the API of Alter.Collection though, so this might need to be changed to allow for both the Action and the Func.

smerrell commented 9 years ago

This could use some discussion since it makes a pretty big change to Alter.Collection.

dportzline83 commented 9 years ago

This change allows "additional" changes that need to happen along side the changes to the collection to be batched in the same transaction. This is very important. You don't want changes that rely on each other to pass/fail independently. :+1:

smerrell commented 9 years ago

Indeed. I'm curious to see what people think about the API changes. We've gone from an Action<RavenJObject, RavenJObject> to a Func<RavenJObject, RavenJObject, IEnumerable<ICommandData>>. This is a pretty big API change so I'm curious if others would want to have the old API around as well or if it is ok to just change from the Action to the Func.

dportzline83 commented 9 years ago

Yep, this would be a breaking change and would require a major version bump. Is there a better way to do this to make it backwards compatible? Or is this the cleanest way?

dportzline83 commented 9 years ago

Merged as part of #33.