You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for composite index definition in grails 5 but can't find full documentation on defining indexes including composite ones. This is quite an important part for the domain that might be overlooked.
Triage note: on the current 8.0.x line, properties that name the same index give a composite index whose columns follow the order the properties are declared in, so your example creates an index on (token, address). I checked this on H2 with both Hibernate 5 and Hibernate 7, and on PostgreSQL 16, MySQL 8 and MariaDB 10.11 with Hibernate 7 (#16847 adds the tests). The column reference now describes it as well.
If you still see (address, token) on a current version, please tell us which Grails version and database you use. To control the order, declare the properties in the order you want the columns.
Activity
ppazos commentedon Dec 26, 2023
I'm looking for composite index definition in grails 5 but can't find full documentation on defining indexes including composite ones. This is quite an important part for the domain that might be overlooked.
Update dependency org.grails:grails-bom to v5.1.3 (#281)
test(hibernate): pin composite index column order on H2 and externall…
borinquenkid commentedon Nov 4, 2026
Triage note: on the current 8.0.x line, properties that name the same index give a composite index whose columns follow the order the properties are declared in, so your example creates an index on
(token, address). I checked this on H2 with both Hibernate 5 and Hibernate 7, and on PostgreSQL 16, MySQL 8 and MariaDB 10.11 with Hibernate 7 (#16847 adds the tests). Thecolumnreference now describes it as well.If you still see
(address, token)on a current version, please tell us which Grails version and database you use. To control the order, declare the properties in the order you want the columns.https://claude.ai/code/session_01Dmki4SQGwRSj8pRJ5KCWyX