Skip to content

Commit

Permalink
⬆️ 更新三方模块依赖版本
Browse files Browse the repository at this point in the history
go: upgraded gorm.io/gorm v1.25.6 => v1.25.7

Signed-off-by: liutianqi <zixizixi@vip.qq.com>
  • Loading branch information
iTanken committed Feb 18, 2024
1 parent a1a90c8 commit 3ce855c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion _dev/script/go-staticcheck.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ echo
cd /d %~dp0/../../

echo. & echo [golangci-lint.run]
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
rem go1.20 latest => v1.55.2
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 run
echo. & echo [staticcheck.io]
go run honnef.co/go/tools/cmd/staticcheck@latest -f text ./...

Expand Down
2 changes: 1 addition & 1 deletion create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestMergeCreateUnique(t *testing.T) {
t.Run("MergeCreateUnique", func(t *testing.T) {
tx := db.Create(&data)
if err = tx.Error; err != nil {
if strings.HasPrefix(err.Error(), "ORA-00001") {
if strings.Contains(err.Error(), "ORA-00001") {
t.Log(err) // ORA-00001: 违反唯一约束条件
var gotData []TestTableUserUnique
tx = db.Where(map[string]interface{}{"uid": []string{"U1", "U2"}}).Find(&gotData)
Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ go 1.16
require (
github.com/emirpasic/gods v1.18.1
github.com/sijms/go-ora/v2 v2.8.7
gorm.io/gorm v1.25.6
gorm.io/gorm v1.25.7
)

exclude (
github.com/sijms/go-ora/v2 v2.8.8 // ORA-03137: 来自客户机的格式错误的 TTC 包被拒绝: [opiexe: protocol violation]
github.com/sijms/go-ora/v2 v2.8.9 // has bug
)

retract (
Expand Down
7 changes: 4 additions & 3 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ func (m Migrator) FullDataTypeOf(field *schema.Field) (expr clause.Expr) {
expr.SQL += " NOT NULL"
}

if field.Unique {
expr.SQL += " UNIQUE"
}
// see https://github.com/go-gorm/gorm/pull/6822
//if field.Unique {
// expr.SQL += " UNIQUE"
//}

return
}
Expand Down

0 comments on commit 3ce855c

Please sign in to comment.