Skip to content

Commit da6db07

Browse files
fix(memory): Use text as the underlying type of string (coze-dev#129)
1 parent e9a738a commit da6db07

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

backend/domain/memory/database/internal/convertor/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
func SwitchToDataType(itemType table.FieldItemType) entity.DataType {
3434
switch itemType {
3535
case table.FieldItemType_Text:
36-
return entity.TypeVarchar
36+
return entity.TypeText
3737
case table.FieldItemType_Number:
3838
return entity.TypeBigInt
3939
case table.FieldItemType_Date:

backend/infra/impl/rdb/mysql.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func (m *mysqlService) CreateTable(ctx context.Context, req *rdb.CreateTableRequ
6464
if col.DefaultValue != nil {
6565
if col.DataType == entity2.TypeTimestamp {
6666
colDef += fmt.Sprintf(" DEFAULT %s", *col.DefaultValue)
67+
} else if col.DataType == entity2.TypeText {
68+
// do nothing
6769
} else {
6870
colDef += fmt.Sprintf(" DEFAULT '%s'", *col.DefaultValue)
6971
}

0 commit comments

Comments
 (0)