Commit b19f762
fix(api-server): mark session_messages seq as read-only in Gorm model
The refactor from raw SQL to g2.Create(msg) in PR #1660 caused Gorm
to include seq=0 in INSERT statements, colliding with the unique
constraint when a seq=0 row already existed. The -> tag tells Gorm
to omit seq from writes and let the Postgres DEFAULT nextval() fire,
while still reading the value back via the RETURNING clause.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 61894f1 commit b19f762
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments