Commit fc53d8b
authored
Fix non-portable BLOB columnDefinition in WebAuthnCredential (#275)
* fix: Remove non-portable BLOB columnDefinition from WebAuthnCredential
Remove hardcoded `columnDefinition = "BLOB"` from three byte[] fields
in WebAuthnCredential. The `@Lob` annotation already handles dialect-
appropriate type mapping (BLOB for MySQL, bytea for PostgreSQL, etc.).
The explicit columnDefinition bypassed Hibernate's dialect translation,
causing DDL failures on PostgreSQL and other non-MySQL databases.
Fixes #274
* fix: Use plain byte[] instead of @lob for portable WebAuthn columns
Replace `@Lob @column(columnDefinition = "BLOB")` with plain `byte[]`
and explicit `@Column(length = ...)` on the three binary fields in
WebAuthnCredential.
`@Lob` on byte[] in Hibernate 7 generates literal `blob` in DDL,
which bypasses dialect translation and fails on PostgreSQL (no `blob`
type). Plain byte[] lets each dialect choose the correct native type:
`bytea` on PostgreSQL, `varbinary`/`mediumblob` on MySQL.
Verified DDL generation against a real PostgreSQL 16 instance and
confirmed all three columns map to `bytea`. Full H2 test suite passes
with no regressions.
Fixes #2741 parent 9197e84 commit fc53d8b
1 file changed
Lines changed: 3 additions & 7 deletions
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
| 33 | + | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
| |||
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
64 | | - | |
| 61 | + | |
65 | 62 | | |
66 | 63 | | |
67 | 64 | | |
68 | | - | |
69 | | - | |
| 65 | + | |
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
| |||
0 commit comments