HHH-16320 Add migration guide entry for H2 JSON change

This commit is contained in:
Christian Beikov 2023-03-17 10:26:31 +01:00
parent c21ec81e6d
commit f694e2042a

View File

@ -50,6 +50,20 @@ To get the old behavior, annotate the column with `@Column(definition = "clob")`
This change was done because `blob` and `json` are way more efficient and because we don't expect wide usage of `SqlTypes.JSON` yet.
[[ddl-json-h2]]
=== JSON mapping changes on H2
On H2 1.4.200+, the type code `SqlTypes.JSON` now by default refers to the DDL type `json`, whereas before it was using `clob`.
Due to this change, schema validation errors could occur on existing databases.
The migration to `json` requires a migration expression like `cast(old as json)`.
Note that this change in behavior is backwards compatible and you do not need to change your schema,
unless you are running into schema validation errors and want to fix them.
To get the old behavior, annotate the column with `@Column(definition = "clob")`.
This change was done because the native `json` type is more efficient and because we don't expect wide usage of `SqlTypes.JSON` yet.
[[ddl-implicit-datatype-enum]]
=== Datatype for enums