I need to create tables based on existing classes form the library using jOOQ. It's possible to use DB migration scripts (something like V1__first_script.sql) manually.
The question: is it possible to generate migration scripts or create tables by jOOQ exactly from the java class? Avoiding to write SQL scripts manually.
Thanks!
You can use one of the DSLContext.ddl()
methods to generate a set of DDL queries from jOOQ generated code. Beware that this will not reproduce all of your schema definition, only the parts that the jOOQ API can represent. E.g. CHECK
constraints are not yet included.