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
|
|
@ -16,7 +16,7 @@ import (
|
|||
type ReportUpdater = db.Updater[table.ReportTable, model.Report]
|
||||
|
||||
func ReportInsert(ctx context.Context, txn db.Ex, m model.Report) (model.Report, error) {
|
||||
statement := table.Report.INSERT(table.Report.AllColumns).
|
||||
statement := table.Report.INSERT(table.Report.MutableColumns).
|
||||
MODEL(m).
|
||||
RETURNING(table.Report.AllColumns)
|
||||
return db.ExecuteOneTx[model.Report](ctx, txn, statement)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue