Only set mutable columns on insert
Because we don't want to set ID and other primary keys
This commit is contained in:
parent
61ad3fbe45
commit
0fc46d5916
8 changed files with 9 additions and 9 deletions
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func ReportLogInsert(ctx context.Context, txn db.Ex, m model.ReportLog) (model.ReportLog, error) {
|
||||
statement := table.ReportLog.INSERT(table.ReportLog.AllColumns).
|
||||
statement := table.ReportLog.INSERT(table.ReportLog.MutableColumns).
|
||||
MODEL(m).
|
||||
RETURNING(table.ReportLog.AllColumns)
|
||||
return db.ExecuteOneTx[model.ReportLog](ctx, txn, statement)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue