Skip to content

Commit

Permalink
enhance: Remove varchar column cannot use auto ID constraint
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Feb 19, 2024
1 parent 903137b commit 2d82349
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions client/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ func (c *GrpcClient) validateSchema(sch *entity.Schema) error {
if autoID {
return errors.New("only one auto id is available")
}
if field.DataType != entity.FieldTypeInt64 {
return errors.New("only int64 column can be auto generated id")
}
autoID = true
}
if field.DataType == entity.FieldTypeJSON {
Expand Down
7 changes: 0 additions & 7 deletions client/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,6 @@ func (s *CollectionSuite) TestNewCollection() {
err := c.NewCollection(ctx, testCollectionName, testVectorDim, WithPKFieldName("my_pk"), WithPKFieldType(entity.FieldTypeVarChar), WithVectorFieldName("embedding"), WithConsistencyLevel(entity.ClEventually))
s.NoError(err)
})

s.Run("varchar_autoid", func() {
defer s.resetMock()

err := c.NewCollection(ctx, testCollectionName, testVectorDim, WithPKFieldType(entity.FieldTypeVarChar), WithAutoID(true))
s.Error(err)
})
}

func (s *CollectionSuite) TestRenameCollection() {
Expand Down

0 comments on commit 2d82349

Please sign in to comment.