@@ -230,6 +230,32 @@ func (s *WriterTestSuite) testMigrate(
230230 }
231231 })
232232
233+ t .Run ("move_to_cq_id_only" + suffix , func (t * testing.T ) {
234+ if ! forceMigrate && ! s .tests .SafeMigrations .MovePKToCQOnly {
235+ t .Skip ("skipping test: move_to_cq_id_only" )
236+ }
237+ tableName := "move_to_cq_id_only" + suffix + "_" + tableUUIDSuffix ()
238+ source := & schema.Table {
239+ Name : tableName ,
240+ Columns : schema.ColumnList {
241+ {Name : "_cq_id" , Type : types .ExtensionTypes .UUID , NotNull : true , Unique : true },
242+ {Name : "id" , Type : arrow .PrimitiveTypes .Int64 , PrimaryKey : true },
243+ {Name : "uuid" , Type : types .ExtensionTypes .UUID },
244+ {Name : "bool" , Type : arrow .FixedWidthTypes .Boolean , NotNull : true },
245+ }}
246+ target := & schema.Table {
247+ Name : tableName ,
248+ Columns : schema.ColumnList {
249+ {Name : "_cq_id" , Type : types .ExtensionTypes .UUID , NotNull : true , Unique : true , PrimaryKey : true },
250+ {Name : "id" , Type : arrow .PrimitiveTypes .Int64 },
251+ {Name : "uuid" , Type : types .ExtensionTypes .UUID },
252+ {Name : "bool" , Type : arrow .FixedWidthTypes .Boolean , NotNull : true },
253+ }}
254+ if err := s .migrate (ctx , target , source , s .tests .SafeMigrations .MovePKToCQOnly , forceMigrate ); err != nil {
255+ t .Fatalf ("failed to migrate move_to_cq_id_only: %v" , err )
256+ }
257+ })
258+
233259 t .Run ("double_migration" , func (t * testing.T ) {
234260 if forceMigrate {
235261 t .Skip ("double migration test has sense only for safe migrations" )
0 commit comments