diff --git a/src/Marten/Events/CodeGeneration/EventDocumentStorageGenerator.cs b/src/Marten/Events/CodeGeneration/EventDocumentStorageGenerator.cs index 4279c18099..65f64a6604 100644 --- a/src/Marten/Events/CodeGeneration/EventDocumentStorageGenerator.cs +++ b/src/Marten/Events/CodeGeneration/EventDocumentStorageGenerator.cs @@ -122,7 +122,7 @@ private static GeneratedType buildUpdateStreamVersion(GeneratedType builderType, configureCommand.Frames.AppendSql("set version = "); configureCommand.SetParameterFromMember(0, x => x.Version); - configureCommand.Frames.AppendSql("where id = "); + configureCommand.Frames.AppendSql(" where id = "); if (graph.StreamIdentity == StreamIdentity.AsGuid) { configureCommand.SetParameterFromMember(1, x => x.Id); @@ -132,7 +132,7 @@ private static GeneratedType buildUpdateStreamVersion(GeneratedType builderType, configureCommand.SetParameterFromMember(1, x => x.Key); } - configureCommand.Frames.AppendSql("and version = "); + configureCommand.Frames.AppendSql(" and version = "); configureCommand.SetParameterFromMember(2, x => x.ExpectedVersionOnServer); if (graph.TenancyStyle == TenancyStyle.Conjoined)