@@ -249,6 +249,33 @@ func (s *WriterTestSuite) testMigrate(
249249 }
250250 })
251251
252+ t .Run ("remove_unique_constraint_only" + suffix , func (t * testing.T ) {
253+ if ! forceMigrate && ! s .tests .SafeMigrations .RemoveUniqueConstraint {
254+ t .Skip ("skipping test: remove_unique_constraint_only" )
255+ }
256+ tableName := "remove_unique_constraint_only" + suffix + "_" + tableUUIDSuffix ()
257+ source := & schema.Table {
258+ Name : tableName ,
259+ Columns : schema.ColumnList {
260+ {Name : "_cq_id" , Type : types .ExtensionTypes .UUID , Unique : true },
261+ {Name : "id" , Type : arrow .PrimitiveTypes .Int64 },
262+ {Name : "uuid" , Type : types .ExtensionTypes .UUID },
263+ {Name : "bool" , Type : arrow .FixedWidthTypes .Boolean , NotNull : true },
264+ }}
265+ target := & schema.Table {
266+ Name : tableName ,
267+ Columns : schema.ColumnList {
268+ {Name : "_cq_id" , Type : types .ExtensionTypes .UUID },
269+ {Name : "id" , Type : arrow .PrimitiveTypes .Int64 },
270+ {Name : "uuid" , Type : types .ExtensionTypes .UUID },
271+ {Name : "bool" , Type : arrow .FixedWidthTypes .Boolean , NotNull : true },
272+ }}
273+ require .NoError (t , s .migrate (ctx , target , source , s .tests .SafeMigrations .RemoveUniqueConstraint , forceMigrate ))
274+ if ! forceMigrate {
275+ require .NoError (t , s .migrate (ctx , target , target , true , false ))
276+ }
277+ })
278+
252279 t .Run ("move_to_cq_id_only" + suffix , func (t * testing.T ) {
253280 if ! forceMigrate && ! s .tests .SafeMigrations .MovePKToCQOnly {
254281 t .Skip ("skipping test: move_to_cq_id_only" )
0 commit comments