Commit fda7f10
fix(api): use varchar(64) instead of char(64) in GORM models to prevent unnecessary ALTER TABLE on every pod startup (#461)
PostgreSQL stores char(64) as bpchar internally. GORM AutoMigrate compares
the model type "char(64)" against the database type "bpchar" and sees a
mismatch, issuing ALTER TABLE ... ALTER COLUMN TYPE char(64) on every pod
restart. This ALTER acquires an ACCESS EXCLUSIVE lock, blocking all
reads/writes and causing cascading connection pool exhaustion under load.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3ee9a19 commit fda7f10
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments