Add enums module: enum mapping in Hibernate 7.4.17.Final (ORDINAL trap, STRING, PostgreSQL native enum, AttributeConverter, @EnumeratedValue), what release 2 reads and writes after a constant is inserted, appended or renamed, hbm2ddl=update limits, migrations (H2 2.4.240, PostgreSQL 18.6)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5y3ArhRbakfu1ELsP
This commit is contained in:
Claude
2026-11-19 23:00:31 +05:30
parent 0db721805b
commit bd0f33a306
22 changed files with 1785 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# The migration each enum change needs (PostgreSQL 18), and release 2 afterwards
# Hibernate ORM 7.4.17.Final, H2 2.4.240 and PostgreSQL 18.6, JDK 25
== ORDINAL: insert CANCELLED between NEW and PAID
migration : drop check; UPDATE orders SET status = status + 1 WHERE status >= 1; add check (status between 0 and 3)
stored : [1 | 0, 2 | 2, 3 | 3]
release 2 reads : [NEW, PAID, SHIPPED]
release 2 writes CANCELLED : OK, stored [1]
== STRING: append CANCELLED
migration : drop check; add check (status in ('NEW', 'PAID', 'SHIPPED', 'CANCELLED'))
release 2 writes CANCELLED : OK, rows [1 | PAID, 10 | CANCELLED]
== STRING: rename PAID to PAYMENT_RECEIVED
migration : drop check; UPDATE ... SET status = 'PAYMENT_RECEIVED' WHERE status = 'PAID'; add check
release 2 reads : [NEW, PAYMENT_RECEIVED]
== CONVERTER or @EnumeratedValue: insert CANCELLED and rename PAID (codes unchanged)
migration : drop check; add check (status in ('N', 'C', 'P', 'S')); no UPDATE, no data touched
release 2 reads : [PAYMENT_RECEIVED]
release 2 writes CANCELLED : OK, stored [C]