diff --git a/Directory.Build.props b/Directory.Build.props index 0b01f07c54..5eb8c51229 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 7.27.0 + 7.28.0 12.0 Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko https://martendb.io/logo.png diff --git a/src/Marten/Marten.csproj b/src/Marten/Marten.csproj index ec4bc1f664..b9f78ff081 100644 --- a/src/Marten/Marten.csproj +++ b/src/Marten/Marten.csproj @@ -48,7 +48,7 @@ - + diff --git a/src/Marten/Schema/MartenManagedTenantListPartitions.cs b/src/Marten/Schema/MartenManagedTenantListPartitions.cs index 7f3328cc4a..504ccc3f8e 100644 --- a/src/Marten/Schema/MartenManagedTenantListPartitions.cs +++ b/src/Marten/Schema/MartenManagedTenantListPartitions.cs @@ -28,7 +28,6 @@ public MartenManagedTenantListPartitions(StoreOptions options, string? schemaNam _options.Storage.Add(Partitions); _options.TenantPartitions = this; - } public ManagedListPartitions Partitions { get; } diff --git a/src/Marten/Storage/DefaultTenancy.cs b/src/Marten/Storage/DefaultTenancy.cs index 461727507a..6ceedc85ae 100644 --- a/src/Marten/Storage/DefaultTenancy.cs +++ b/src/Marten/Storage/DefaultTenancy.cs @@ -49,7 +49,13 @@ public ValueTask> BuildDatabases() internal void Initialize() { - Default = new Tenant(DefaultTenantId, new MartenDatabase(Options, _dataSource, Options.StoreName)); + var martenDatabase = new MartenDatabase(Options, _dataSource, Options.StoreName); + if (Options.TenantPartitions != null) + { + martenDatabase.AddInitializer(Options.TenantPartitions.Partitions); + } + + Default = new Tenant(DefaultTenantId, martenDatabase); } public void Dispose()