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)
    • getDatabase

      @Deprecated public String getDatabase()
      Deprecated.
      since 1.1.0, see getOptionalDatabase()
      Returns:
      An optional target database, maybe null
    • 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
    • getImpersonatedUser

      @Deprecated public String getImpersonatedUser()
      Deprecated.
      Returns:
      An optional user to impersonate, maybe null
    • getOptionalImpersonatedUser

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

      @Deprecated public String getInstalledBy()
      Deprecated.
      since 1.1.0, see getOptionalInstalledBy()
      Returns:
      Optional user information about the user executing the migration, maybe null
    • 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
    • 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
    • hasPlacesToLookForMigrations

      @Deprecated public boolean hasPlacesToLookForMigrations()
      Deprecated.
      Since 1.1.0, will be removed from public without replacement.
      This is internal API and will be made package private in 2.0.0
      Returns:
      True if there are packages to scan