(ctx context.Context)
| 142 | } |
| 143 | |
| 144 | func (_u *DecisionUpdate) sqlSave(ctx context.Context) (_node int, err error) { |
| 145 | _spec := sqlgraph.NewUpdateSpec(decision.Table, decision.Columns, sqlgraph.NewFieldSpec(decision.FieldID, field.TypeInt)) |
| 146 | if ps := _u.mutation.predicates; len(ps) > 0 { |
| 147 | _spec.Predicate = func(selector *sql.Selector) { |
| 148 | for i := range ps { |
| 149 | ps[i](selector) |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | if value, ok := _u.mutation.UpdatedAt(); ok { |
| 154 | _spec.SetField(decision.FieldUpdatedAt, field.TypeTime, value) |
| 155 | } |
| 156 | if value, ok := _u.mutation.Until(); ok { |
| 157 | _spec.SetField(decision.FieldUntil, field.TypeTime, value) |
| 158 | } |
| 159 | if _u.mutation.UntilCleared() { |
| 160 | _spec.ClearField(decision.FieldUntil, field.TypeTime) |
| 161 | } |
| 162 | if _u.mutation.StartIPCleared() { |
| 163 | _spec.ClearField(decision.FieldStartIP, field.TypeInt64) |
| 164 | } |
| 165 | if _u.mutation.EndIPCleared() { |
| 166 | _spec.ClearField(decision.FieldEndIP, field.TypeInt64) |
| 167 | } |
| 168 | if _u.mutation.StartSuffixCleared() { |
| 169 | _spec.ClearField(decision.FieldStartSuffix, field.TypeInt64) |
| 170 | } |
| 171 | if _u.mutation.EndSuffixCleared() { |
| 172 | _spec.ClearField(decision.FieldEndSuffix, field.TypeInt64) |
| 173 | } |
| 174 | if _u.mutation.IPSizeCleared() { |
| 175 | _spec.ClearField(decision.FieldIPSize, field.TypeInt64) |
| 176 | } |
| 177 | if _u.mutation.UUIDCleared() { |
| 178 | _spec.ClearField(decision.FieldUUID, field.TypeString) |
| 179 | } |
| 180 | if _u.mutation.OwnerCleared() { |
| 181 | edge := &sqlgraph.EdgeSpec{ |
| 182 | Rel: sqlgraph.M2O, |
| 183 | Inverse: true, |
| 184 | Table: decision.OwnerTable, |
| 185 | Columns: []string{decision.OwnerColumn}, |
| 186 | Bidi: false, |
| 187 | Target: &sqlgraph.EdgeTarget{ |
| 188 | IDSpec: sqlgraph.NewFieldSpec(alert.FieldID, field.TypeInt), |
| 189 | }, |
| 190 | } |
| 191 | _spec.Edges.Clear = append(_spec.Edges.Clear, edge) |
| 192 | } |
| 193 | if nodes := _u.mutation.OwnerIDs(); len(nodes) > 0 { |
| 194 | edge := &sqlgraph.EdgeSpec{ |
| 195 | Rel: sqlgraph.M2O, |
| 196 | Inverse: true, |
| 197 | Table: decision.OwnerTable, |
| 198 | Columns: []string{decision.OwnerColumn}, |
| 199 | Bidi: false, |
| 200 | Target: &sqlgraph.EdgeTarget{ |
| 201 | IDSpec: sqlgraph.NewFieldSpec(alert.FieldID, field.TypeInt), |
nothing calls this directly
no test coverage detected