Update logic
This commit is contained in:
parent
da3b864e24
commit
a3740aec5a
@ -75,8 +75,8 @@ func updateCallback(scope *Scope) {
|
||||
} else {
|
||||
for _, field := range scope.Fields() {
|
||||
if scope.changeableField(field) {
|
||||
if !field.IsPrimaryKey && field.IsNormal && (field.Name != "CreatedAt" || !field.IsBlank) {
|
||||
if !field.IsForeignKey && (!field.IsBlank || field.HasDefaultValue) {
|
||||
if !field.IsPrimaryKey && field.IsNormal && !field.IsBlank {
|
||||
if !field.IsForeignKey || !field.IsBlank || !field.HasDefaultValue {
|
||||
sqls = append(sqls, fmt.Sprintf("%v = %v", scope.Quote(field.DBName), scope.AddToVars(field.Field.Interface())))
|
||||
}
|
||||
} else if relationship := field.Relationship; relationship != nil && relationship.Kind == "belongs_to" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user