Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions backend/infra/impl/rdb/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading