Skip to content

Commit

Permalink
Addressing the migration issues with boolean values in list partitions.
Browse files Browse the repository at this point in the history
Closes GH-3572
  • Loading branch information
jeremydmiller committed Dec 10, 2024
1 parent 05a5f39 commit 539d079
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/CoreTests/Partitioning/partitioning_configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void configure_for_soft_deleted()
var table = tableFor<Target>();

var partitioning = table.Partitioning.ShouldBeOfType<ListPartitioning>();
partitioning.Partitions.Single().ShouldBe(new ListPartition("deleted", "TRUE"));
partitioning.Partitions.Single().ShouldBe(new ListPartition("deleted", "true"));
}

[Fact]
Expand All @@ -48,7 +48,7 @@ public void configure_for_soft_deleted_and_index()
var table = tableFor<Target>();

var partitioning = table.Partitioning.ShouldBeOfType<ListPartitioning>();
partitioning.Partitions.Single().ShouldBe(new ListPartition("deleted", "TRUE"));
partitioning.Partitions.Single().ShouldBe(new ListPartition("deleted", "true"));
}

[Fact]
Expand All @@ -60,13 +60,13 @@ public void all_documents_are_soft_deleted_and_partitioned()
.ShouldBeOfType<ListPartitioning>()
.Partitions
.Single()
.ShouldBe(new ListPartition("deleted", "TRUE"));
.ShouldBe(new ListPartition("deleted", "true"));

tableFor<User>().Partitioning
.ShouldBeOfType<ListPartitioning>()
.Partitions
.Single()
.ShouldBe(new ListPartition("deleted", "TRUE"));
.ShouldBe(new ListPartition("deleted", "true"));
}

[Fact]
Expand Down
25 changes: 25 additions & 0 deletions src/CoreTests/Partitioning/partitioning_migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,29 @@ public async Task should_create_delta_for_adding_all_new_partitions()
var migration = await store2.Storage.CreateMigrationAsync();
migration.Difference.ShouldBe(SchemaPatchDifference.Update);
}

[Fact]
public async Task partitioning_with_soft_deletes_multiple_migrations()
{
StoreOptions(opts =>
{
opts.Schema.For<Target>();
});

await theStore.Storage.ApplyAllConfiguredChangesToDatabaseAsync();

var store2 = SeparateStore(opts =>
{
opts.Schema.For<Target>().SoftDeletedWithPartitioning();
});

await store2.Storage.ApplyAllConfiguredChangesToDatabaseAsync();

var store3 = SeparateStore(opts =>
{
opts.Schema.For<Target>().SoftDeletedWithPartitioning();
});

await store3.Storage.Database.AssertDatabaseMatchesConfigurationAsync();
}
}
2 changes: 1 addition & 1 deletion src/Marten.CommandLine/Marten.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PackageReference Include="JasperFx.CodeGeneration.Commands" Version="3.7.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Oakton" Version="6.3.0" />
<PackageReference Include="Weasel.CommandLine" Version="7.12.1" />
<PackageReference Include="Weasel.CommandLine" Version="7.12.3" />
</ItemGroup>
<Import Project="../../Analysis.Build.props"/>
</Project>
2 changes: 1 addition & 1 deletion src/Marten/Marten.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<PackageReference Include="Polly.Core" Version="8.5.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Weasel.Postgresql" Version="7.12.1" />
<PackageReference Include="Weasel.Postgresql" Version="7.12.3" />
</ItemGroup>

<!--SourceLink specific settings-->
Expand Down

0 comments on commit 539d079

Please sign in to comment.