Class MigrationsConfig

java.lang.Object
ac.simons.neo4j.migrations.core.MigrationsConfig

public final class MigrationsConfig extends Object
Configuration for Migrations.
Since:
0.0.1
Author:
Michael J. Simons
  • Method Details

    • builder

      public static MigrationsConfig.Builder builder()
      Start building a new configuration.
      Returns:
      The entry point for creating a new configuration.
      Since:
      0.0.1
    • defaultConfig

      public static MigrationsConfig defaultConfig()
      Returns:
      The default config
      Since:
      0.0.6
    • getPackagesToScan

      public String[] getPackagesToScan()
      Returns:
      the list of packages to scan
    • getLocationsToScan

      public String[] getLocationsToScan()
      Returns:
      the list of locations to scan
    • getTransactionMode

      public MigrationsConfig.TransactionMode getTransactionMode()
      Returns:
      the transaction mode (whether to use one transaction for per migration or per statement)
    • getOptionalDatabase

      public Optional<String> getOptionalDatabase()
      Returns:
      An optional target database
      Since:
      1.1.0
    • getOptionalSchemaDatabase

      public Optional<String> getOptionalSchemaDatabase()
      Returns:
      An optional schema database
      Since:
      1.1.0
    • getOptionalImpersonatedUser

      public Optional<String> getOptionalImpersonatedUser()
      Returns:
      An optional user to impersonate
      Since:
      1.1.0
    • getOptionalInstalledBy

      public Optional<String> getOptionalInstalledBy()
      Returns:
      Optional user information about the user executing the migration
      Since:
      1.1.0
    • isValidateOnMigrate

      public boolean isValidateOnMigrate()
      Returns:
      true if resolved migrations and database state should be validated before a migration attempt is applied
    • isAutocrlf

      public boolean isAutocrlf()
      Returns:
      whether CRLF line endings should be automatically converted into LF
    • getMigrationClassesDiscoverer

      public Discoverer<JavaBasedMigration> getMigrationClassesDiscoverer()
      Returns:
      The discoverer for class based migrations, never null
      Since:
      1.3.0
    • getResourceScanner

      public ClasspathResourceScanner getResourceScanner()
      Returns:
      The resource scanner, never null
      Since:
      1.3.0
    • getOptionalDelayBetweenMigrations

      public Optional<Duration> getOptionalDelayBetweenMigrations()
      Returns:
      The delay to apply between migrations
      Since:
      2.3.2
    • getConstraintRenderingOptions

      public List<? extends RenderConfig.AdditionalRenderingOptions> getConstraintRenderingOptions()
      Returns the list of additional options to use when rendering constraints.
      Returns:
      the list of additional options to use when rendering constraints
      Since:
      2.8.2
    • getTransactionTimeout

      public Duration getTransactionTimeout()
      Returns the transaction timeout, null indicates all transactions will use the drivers default timeout.
      Returns:
      the transaction timeout, null indicates all transactions will use the drivers default timeout
      Since:
      2.13.0
    • isOutOfOrder

      public boolean isOutOfOrder()
      When this flag is set to true, new migrations discovered that are "out of order", such as a version 15 is to be found between 10 and 20, it will be accepted, integrated into the chain and then move on instead of throwing an error.
      Returns:
      true if migrations shall be allowed to be out of order
      Since:
      2.14.0
    • getTarget

      public String getTarget()
      Returns a valid target version or one of three dedicated values.
      Returns:
      a valid target version or one of three dedicated values
      Since:
      2.15.0
    • isUseFlywayCompatibleChecksums

      public boolean isUseFlywayCompatibleChecksums()
      Returns if Flyway compatible checksums should be used.
      Returns:
      if Flyway compatible checksums should be used
      Since:
      2.17.0
    • logTo

      public void logTo(Logger logger, boolean verbose)
      Helper method to pretty print this configuration into a logger (on level INFO respectively WARNING.
      Parameters:
      logger - the logger to print to
      verbose - set to true if you want to print all details
    • getVersionSortOrder

      public MigrationsConfig.VersionSortOrder getVersionSortOrder()
      Returns the configured version sort order.
      Returns:
      the configured version sort order