Skip to content

Commit

Permalink
✅ 修改优化单元测试相关代码
Browse files Browse the repository at this point in the history
Signed-off-by: liutianqi <zixizixi@vip.qq.com>
  • Loading branch information
iTanken committed Apr 28, 2024
1 parent fa7fb1d commit 2e25a52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestMergeCreate(t *testing.T) {
}
if err = migrator.AutoMigrate(model); err != nil {
t.Fatalf("AutoMigrate() error = %v", err)
} else if err == nil {
} else {
t.Log("AutoMigrate() success!")
}

Expand Down Expand Up @@ -110,7 +110,7 @@ func TestMergeCreateUnique(t *testing.T) {
}
if err = migrator.AutoMigrate(model); err != nil {
t.Fatalf("AutoMigrate() error = %v", err)
} else if err == nil {
} else {
t.Log("AutoMigrate() success!")
}

Expand Down
7 changes: 6 additions & 1 deletion datatypes_json_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ func (JSONMap) GormDBDataType(db *gorm.DB, field *schema.Field) string {
case "sqlserver":
return "NVARCHAR(MAX)"
case "oracle":
return "BLOB"
//return "BLOB"
// BLOB is only supported in Oracle databases version 12c r12.2.0.1.0 and above.
// to support lower versions of Oracle databases, it is recommended to use CLOB.
// see also:
// https://stackoverflow.com/questions/43603905/oracle-12c-error-getting-while-create-blob-column-table-with-json-type
return "CLOB"
default:
return getGormTypeFromTag(field)
}
Expand Down

0 comments on commit 2e25a52

Please sign in to comment.