JOOQ Creating table with indices

Viewed 167

As per documentation in order to create a table with JOOQ:

context.createTable("table")
      .column("column1", INTEGER)
      .column("column2", VARCHAR(10).nullable(false))
      .constraints(
          primaryKey("column1"),
          unique("column2"),
          foreignKey("column2").references("some_other_table"),
          check(field(name("column2")).like("A%"))
      )
      .execute();

However, it seems like that it's also possible to declare indices at table creation:

context.createTable("table")
      .column("column1", INTEGER)
      .column("column2", VARCHAR(10).nullable(false))
      .constraints(
          primaryKey("column1"),
          unique("column2"),
          foreignKey("column2").references("some_other_table"),
          check(field(name("column2")).like("A%"))
      )
      .indexes(...indices)
      .execute();

I can't find anything in documentation explaining how to do that.

What is a proper way to declare indicies this way?

1 Answers
Related