Skip to content

Commit

Permalink
移除强制设置id为主键代码
Browse files Browse the repository at this point in the history
  • Loading branch information
shenqh committed Dec 20, 2024
1 parent f482f25 commit 9a4e98c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam
if prioritizedPrimaryField != nil {
if prioritizedPrimaryField.PrimaryKey {
schema.PrioritizedPrimaryField = prioritizedPrimaryField
} else if len(schema.PrimaryFields) == 0 {
prioritizedPrimaryField.PrimaryKey = true
schema.PrioritizedPrimaryField = prioritizedPrimaryField
schema.PrimaryFields = append(schema.PrimaryFields, prioritizedPrimaryField)
}
}

Expand Down

0 comments on commit 9a4e98c

Please sign in to comment.