@@ -148,6 +148,34 @@ public async Task remove_partitions_at_runtime_smoke_test()
148
148
. ShouldBe ( new [ ] { "blue" , "green" , "purple" } ) ;
149
149
}
150
150
151
+ [ Fact ]
152
+ public async Task remove_partitions_by_value_at_runtime_smoke_test ( )
153
+ {
154
+ var database = new ManagedListDatabase ( ) ;
155
+ var partitions = new Dictionary < string , string > { { "red" , "red_suffix" } , { "green" , "green_suffix" } , { "blue" , "blue_suffix" } , } ;
156
+ await database . Partitions . ResetValues ( database , partitions , CancellationToken . None ) ;
157
+
158
+ await database . ApplyAllConfiguredChangesToDatabaseAsync ( ) ;
159
+
160
+ await database . Partitions . AddPartitionToAllTables ( database , "purple" , "purple_suffix" , CancellationToken . None ) ;
161
+
162
+ await database . Partitions . DropPartitionFromAllTablesForValue ( database , NullLogger . Instance , "red" , CancellationToken . None ) ;
163
+
164
+ var tables = await database . FetchExistingTablesAsync ( ) ;
165
+
166
+ var teams = tables . Single ( x => x . Identifier . Name == "teams" ) ;
167
+ var partitioning = teams . Partitioning . ShouldBeOfType < ListPartitioning > ( ) ;
168
+ partitioning . HasExistingDefault . ShouldBeFalse ( ) ;
169
+ partitioning . Partitions . Select ( x => x . Suffix ) . OrderBy ( x => x )
170
+ . ShouldBe ( new [ ] { "blue_suffix" , "green_suffix" , "purple_suffix" } ) ;
171
+
172
+ var players = tables . Single ( x => x . Identifier . Name == "players" ) ;
173
+ partitioning = players . Partitioning . ShouldBeOfType < ListPartitioning > ( ) ;
174
+ partitioning . HasExistingDefault . ShouldBeFalse ( ) ;
175
+ partitioning . Partitions . Select ( x => x . Suffix ) . OrderBy ( x => x )
176
+ . ShouldBe ( new [ ] { "blue_suffix" , "green_suffix" , "purple_suffix" } ) ;
177
+ }
178
+
151
179
[ Fact ]
152
180
public async Task apply_additive_migration_2 ( )
153
181
{
0 commit comments