Similar to here I'm annotating my class with
@Table(indexes = {@Index(columnList = "name")})
which attempts to create a non-unique index with the maximum length of the varchar
column. Unfortunately that's not possible because it's a varchar(255)
column of type utf8mb4
. phpMyAdmin added KEY '...' (name(191))
by clicking on the respective buttons in the UI, so at least my software runs efficient queries now.
Now I was wondering if it's possible to have my Java class auto-generate the index with limited length upon creating the database schema? The code builds on spring-boot-starter-data-jpa:1.4.2.RELEASE
.