Reputation: 799
I'm trying to include my own schema changes (such as varchar to text and create Index) just before entities get bound, just like Hibernate does the schema update. It is ideal if I can include my own custom SQLs in hibernate's schema update itself. For instance by extending an existing hibernate class and allowing application to use mine instead of built-in one.
org.hibernate.internal.SessionFactoryImpl is final.
May be by implementing my own org.hibernate.tool.schema.spi.SchemaMigrator. Anyone tried this before?
BTW, I'm using spring boot v1.4.0.M3, in case it has any specific dependencies, I don't think so.
Cheers!
Upvotes: 0
Views: 507
Reputation: 1955
Spring Boot has a JDBC initializer, it runs .sql scripts at startup. I would recommend using Flyway, it keeps track of the version of your database and which scripts have been executed.
Upvotes: 1