I've noticed this issue also, and just did an upgrade to build 648.
Deleting does not throw an exception anymore, but... the index is not
removed either. :)
For reproduction, this is my code:
public class EntityEntityIdPatch : AbstractIndexCreationTask<Entity>
{
private readonly IDocumentStore store;
public EntityEntityIdPatch(IDocumentStore store)
{
this.store = store;
Execute();
}
public EntityEntityIdPatch()
{
Map = docs => from doc in docs
select new { doc.Label };
}
public void Execute(){
// create index
IndexCreation.CreateIndexes(typeof(EntityEntityIdPatch).Assembly,
store);
// wait for the index
while
(store.DatabaseCommands.GetStatistics().StaleIndexes.Length != 0)
Thread.Sleep(10);
// execute the patch using the index
store.DatabaseCommands.UpdateByIndex("EntityEntityIdPatch",
new IndexQuery(),
new[] {new PatchRequest() {
Type = PatchCommandType.Rename,
Name = "EntityType",
Value = new RavenJValue("EntityTypeId")
}
},false);
// remove the index
store.DatabaseCommands.DeleteIndex("EntityEntityIdPatch");
}
}