SetDeletedAtConfig sets a deletedAt for configuration by adding a single new row with deleted_at set the same as SetConfig is actually insert
(ctx context.Context, userID string, deletedAt sql.NullTime, cfg userconfig.Config)
| 303 | // by adding a single new row with deleted_at set |
| 304 | // the same as SetConfig is actually insert |
| 305 | func (d DB) SetDeletedAtConfig(ctx context.Context, userID string, deletedAt sql.NullTime, cfg userconfig.Config) error { |
| 306 | cfgBytes, err := json.Marshal(cfg) |
| 307 | if err != nil { |
| 308 | return err |
| 309 | } |
| 310 | _, err = d.Insert("configs"). |
| 311 | Columns("owner_id", "owner_type", "subsystem", "deleted_at", "config"). |
| 312 | Values(userID, entityType, subsystem, deletedAt, cfgBytes). |
| 313 | Exec() |
| 314 | return err |
| 315 | } |
| 316 | |
| 317 | // DeactivateConfig deactivates a configuration. |
| 318 | func (d DB) DeactivateConfig(ctx context.Context, userID string) error { |