Hibernate Search 6.2.1.Final [hsearch_agent] wrong column type [id]

I’m trying to upgrade a service to use Hibernate search 6.2.1.Final, for some reason when my spring boot app starts up (against an empty database) it is encountering the error :

Schema-validation: wrong column type encountered in column [id]  in table [hsearch_agent]; found [int8 (Types#BIGINT)], but expecting [char(36) (Types#CHAR)]

I’ve no doubt this is something stupid I have somehow done, but I cannot figure out what it is, presumably hibernate search is creating the hsearch_agent table, Postgres version is 12.16

Any pointers gladly accepted :slight_smile:

Hey,

Hibernate Search 6.2 changes the types for id columns in outbox-related tables. See more details and suggested scripts to upgrade in this migration guide Hibernate Search 6.2.1.Final: Migration Guide from 6.1

If you are starting an app on an entirely clean database you shouldn’t be getting such errors… What I can suggest is make sure that the database really empty and does not contain those two tables hsearch_outbox_event hsearch_agent also check your dependencies, make sure you do not have a mix of different versions of Hibernate Search at the same time.

If that does not help, you’d probably need to provide some reproducer so that we could take a look.

1 Like

Thanks for your input. It turns out that we had a flyway script (unbeknown to me) which created the hsearch… tables manually and so we need to do the migration.

One minor thing is that with the hibernate - ddl-auto: validate it complains that the column should be char(36) and not varchar(36) as per the migration script.

glad you’ve figured it out :smiley: and thanks for the note on column type, we’ll update that.