Class ForeignKeyMigrationGenerator

java.lang.Object
io.github.mfvanek.pg.generator.ForeignKeyMigrationGenerator
All Implemented Interfaces:
DbMigrationGenerator<ForeignKey>

public class ForeignKeyMigrationGenerator extends Object
Migration generator for creating indexes covering foreign keys.
Since:
0.5.0
  • Field Details

  • Constructor Details

    • ForeignKeyMigrationGenerator

      public ForeignKeyMigrationGenerator(@Nonnull GeneratingOptions options)
  • Method Details

    • generate

      protected void generate(@Nonnull StringBuilder queryBuilder, @Nonnull ForeignKey foreignKey)
    • generate

      @Nonnull public final String generate(@Nonnull List<ForeignKey> rows)
      Generates sql migration based on the specified rows.
      Specified by:
      generate in interface DbMigrationGenerator<T extends TableNameAware>
      Parameters:
      rows - a set of data on the basis of which the sql migration will be generated
      Returns:
      generated sql migration