diff --git a/backend/domain/memory/database/internal/convertor/types.go b/backend/domain/memory/database/internal/convertor/types.go index f623fd9c..e999bb29 100644 --- a/backend/domain/memory/database/internal/convertor/types.go +++ b/backend/domain/memory/database/internal/convertor/types.go @@ -33,7 +33,7 @@ const ( func SwitchToDataType(itemType table.FieldItemType) entity.DataType { switch itemType { case table.FieldItemType_Text: - return entity.TypeVarchar + return entity.TypeText case table.FieldItemType_Number: return entity.TypeBigInt case table.FieldItemType_Date: diff --git a/backend/infra/impl/rdb/mysql.go b/backend/infra/impl/rdb/mysql.go index e462e0f4..ca971b9d 100644 --- a/backend/infra/impl/rdb/mysql.go +++ b/backend/infra/impl/rdb/mysql.go @@ -64,6 +64,8 @@ func (m *mysqlService) CreateTable(ctx context.Context, req *rdb.CreateTableRequ if col.DefaultValue != nil { if col.DataType == entity2.TypeTimestamp { colDef += fmt.Sprintf(" DEFAULT %s", *col.DefaultValue) + } else if col.DataType == entity2.TypeText { + // do nothing } else { colDef += fmt.Sprintf(" DEFAULT '%s'", *col.DefaultValue) }