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 final classA builder to create new instances ofconfigurations.static enumThis type has been introduced in 2.19.0 to allow configuration of the Cypher version in which all scripts should be run without the necessity to define this in individual scripts.static enumUsed for configuring the transaction mode in Cypher-based transactions.static enumThis class has been introduced in 2.8.3 to configure the way version numbers are sorted. -
Method Summary
Modifier and TypeMethodDescriptionstatic MigrationsConfig.Builderbuilder()Start building a new configuration.static MigrationsConfigReturns the default config.List<? extends RenderConfig.AdditionalRenderingOptions> Returns the list of additional options to use when rendering constraints.Returns the cypher version used as prefix for all Cypher scripts.String[]Returns the list of locations to scan.Returns the discoverer for class based migrations, never null.Returns an optional target database.Returns the delay to apply between migrations.Returns an optional user to impersonate.Returns optional user information about the user executing the migration.Returns an optional schema database.String[]Returns the list of packages to scan.Returns the resource scanner, never null.Returns a valid target version or one of three dedicated values.Returns the transaction mode (whether to use one transaction for per migration or per statement)}.Returns the transaction timeout,nullindicates all transactions will use the drivers default timeout.Returns the configured version sort order.booleanConfigures whetherCRLFline endings should be automatically converted intoLF.booleanWhen 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.booleanReturns if Flyway compatible checksums should be used.booleanReturns true if a validation should run before migrations are applied.voidHelper 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.- Returns:
- the default config
- Since:
- 0.0.6
-
getPackagesToScan
Returns the list of packages to scan.- Returns:
- the list of packages to scan
-
getLocationsToScan
Returns the list of locations to scan.- Returns:
- the list of locations to scan
-
getTransactionMode
Returns the transaction mode (whether to use one transaction for per migration or per statement)}.- Returns:
- the transaction mode
-
getOptionalDatabase
-
getOptionalSchemaDatabase
-
getOptionalImpersonatedUser
-
getOptionalInstalledBy
-
isValidateOnMigrate
public boolean isValidateOnMigrate()Returns true if a validation should run before migrations are applied.- Returns:
- true if a validation should run before migrations are applied
-
isAutocrlf
public boolean isAutocrlf()Configures whetherCRLFline endings should be automatically converted intoLF.- Returns:
- true to automatically convert line endings
-
getMigrationClassesDiscoverer
Returns the discoverer for class based migrations, never null.- Returns:
- the discoverer for class based migrations, never null
- Since:
- 1.3.0
-
getResourceScanner
Returns the resource scanner, never null.- Returns:
- the resource scanner, never null
- Since:
- 1.3.0
-
getOptionalDelayBetweenMigrations
-
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,nullindicates all transactions will use the drivers default timeout.- Returns:
- the transaction tineout
- 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
-
getCypherVersion
Returns the cypher version used as prefix for all Cypher scripts.- Returns:
- the cypher version used as prefix for all Cypher scripts
- Since:
- 2.19.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
-