Browse Source

Drop collection when schema exists.

pull/1/head
Sebastian 9 years ago
parent
commit
b36c31eeb3
  1. 7
      src/Squidex.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs

7
src/Squidex.Read.MongoDb/Contents/MongoContentRepository_EventHandling.cs

@ -127,6 +127,13 @@ namespace Squidex.Read.MongoDb.Contents
});
}
protected Task On(SchemaDeleted @event, EnvelopeHeaders headers)
{
var collectionName = $"{Prefix}{@event.SchemaId.Id}";
return database.DropCollectionAsync(collectionName);
}
private async Task ForSchemaIdAsync(Guid schemaId, Func<IMongoCollection<MongoContentEntity>, Task> action)
{
var collection = GetCollection(schemaId);

Loading…
Cancel
Save