Package ac.simons.neo4j.migrations.core
Class MigrationsConfig
java.lang.Object
ac.simons.neo4j.migrations.core.MigrationsConfig
Configuration for Migrations.
- Since:
- 0.0.1
- Author:
- Michael J. Simons
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder to create new instances ofconfigurations
.static enum
Used for configuring the transaction mode in Cypher-based transactions.static enum
This class has been introduced in 2.8.3 to configure the way version numbers are sorted. -
Method Summary
Modifier and TypeMethodDescriptionstatic MigrationsConfig.Builder
builder()
Start building a new configuration.static MigrationsConfig
List
<? extends RenderConfig.AdditionalRenderingOptions> Returns the list of additional options to use when rendering constraints.String[]
String[]
Returns a valid target version or one of three dedicated values.Returns the transaction timeout,null
indicates all transactions will use the drivers default timeout.Returns the configured version sort order.boolean
boolean
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.boolean
Returns if Flyway compatible checksums should be used.boolean
void
Helper method to pretty print this configuration into a logger (on level INFO respectively WARNING.
-
Method Details
-
builder
Start building a new configuration.- Returns:
- The entry point for creating a new configuration.
- Since:
- 0.0.1
-
defaultConfig
- Returns:
- The default config
- Since:
- 0.0.6
-
getPackagesToScan
- Returns:
- the list of packages to scan
-
getLocationsToScan
- Returns:
- the list of locations to scan
-
getTransactionMode
- Returns:
- the transaction mode (whether to use one transaction for per migration or per statement)
-
getOptionalDatabase
- Returns:
- An optional target database
- Since:
- 1.1.0
-
getOptionalSchemaDatabase
- Returns:
- An optional schema database
- Since:
- 1.1.0
-
getOptionalImpersonatedUser
- Returns:
- An optional user to impersonate
- Since:
- 1.1.0
-
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
- Returns:
- The discoverer for class based migrations, never null
- Since:
- 1.3.0
-
getResourceScanner
- Returns:
- The resource scanner, never null
- Since:
- 1.3.0
-
getOptionalDelayBetweenMigrations
- Returns:
- The delay to apply between migrations
- Since:
- 2.3.2
-
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
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
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
Helper method to pretty print this configuration into a logger (on level INFO respectively WARNING.- Parameters:
logger
- the logger to print toverbose
- set to true if you want to print all details
-
getVersionSortOrder
Returns the configured version sort order.- Returns:
- the configured version sort order
-