Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing the migration issues with boolean values in list partition… #3586

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
4 changes: 2 additions & 2 deletions src/DocumentDbTests/Deleting/soft_deletes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ public async Task should_partition_through_attribute()
var table = new DocumentTable(theStore.Options.Storage.MappingFor(typeof(SoftDeletedAndPartitionedDocument)));

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

}
}
Expand Down Expand Up @@ -1398,7 +1398,7 @@ public async Task should_partition_through_attribute()
var table = new DocumentTable(theStore.Options.Storage.MappingFor(typeof(SoftDeletedAndPartitionedDocument)));

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

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void events_table_build_partitioning_when_active()
var table = new EventsTable(theGraph);
var partitioning = table.Partitioning.ShouldBeOfType<ListPartitioning>();
partitioning.Columns.Single().ShouldBe(IsArchivedColumn.ColumnName);
partitioning.Partitions.Single().ShouldBe(new ListPartition("archived", "TRUE"));
partitioning.Partitions.Single().ShouldBe(new ListPartition("archived", "true"));

table.PrimaryKeyColumns.ShouldContain(IsArchivedColumn.ColumnName);
}
Expand All @@ -42,7 +42,7 @@ public void streams_table_build_partitioning_when_active()
var table = new StreamsTable(theGraph);
var partitioning = table.Partitioning.ShouldBeOfType<ListPartitioning>();
partitioning.Columns.Single().ShouldBe(IsArchivedColumn.ColumnName);
partitioning.Partitions.Single().ShouldBe(new ListPartition("archived", "TRUE"));
partitioning.Partitions.Single().ShouldBe(new ListPartition("archived", "true"));

table.PrimaryKeyColumns.ShouldContain(IsArchivedColumn.ColumnName);
}
Expand Down
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
Loading