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:
@@ -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]
|
||||
Reference in New Issue
Block a user