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
|
|
@ -18,7 +18,7 @@ func AccountFromID(ctx context.Context, org_id string) (model.Account, error) {
|
|||
return db.ExecuteOne[model.Account](ctx, statement)
|
||||
}
|
||||
func AccountInsert(ctx context.Context, txn bob.Tx, m *model.Account) (model.Account, error) {
|
||||
statement := table.Account.INSERT(table.Account.AllColumns).
|
||||
statement := table.Account.INSERT(table.Account.MutableColumns).
|
||||
MODEL(m).
|
||||
RETURNING(table.Account.AllColumns)
|
||||
return db.ExecuteOneTxBob[model.Account](ctx, txn, statement)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue