WL-2819 Create indexes on the hierarchy code.

Hibernate doesn't create indexes so do it manually.