# GenerateMigrationsTask

abstract class GenerateMigrationsTask : DefaultTask

Task for generating SQL migration scripts from Exposed table definitions. Uses the Gradle Workers API for better isolation and parallel execution.

## Constructors

GenerateMigrationsTask
Link copied to clipboard
constructor()

## Properties

actions
Link copied to clipboard
open var actions: List<Action<in Task?>?>?
ant
Link copied to clipboard
open val ant: AntBuilder?
asDynamicObject
Link copied to clipboard
@get:Internal
open val asDynamicObject: DynamicObject?
classpath
Link copied to clipboard
@get:InputFiles
abstract val classpath: ConfigurableFileCollection

Optional classpath that is scanned for Exposed table definitions. Defaults to the project's runtime classpath.

convention
Link copied to clipboard
@get:Internal
open override val convention: Convention?
databasePassword
Link copied to clipboard
@get:Input
@get:Optional
abstract val databasePassword: Property<String>

Optional password for the database connection, which should be considered as the current schema.

databaseUrl
Link copied to clipboard
@get:Input
@get:Optional
abstract val databaseUrl: Property<String>

Optional URL for the database connection, which should be considered as the current schema.

databaseUser
Link copied to clipboard
@get:Input
@get:Optional
abstract val databaseUser: Property<String>

Optional username for the database connection, which should be considered as the current schema.

dependsOn
Link copied to clipboard
open val dependsOn: Set<Any?>?
description
Link copied to clipboard
open var description: String?
destroyables
Link copied to clipboard
open val destroyables: TaskDestroyables?
didWork
Link copied to clipboard
open var didWork: Boolean
enabled
Link copied to clipboard
open var enabled: Boolean
extensions
Link copied to clipboard
open val extensions: ExtensionContainer?
fileDirectory
Link copied to clipboard
@get:OutputDirectory
abstract val fileDirectory: DirectoryProperty

Directory where the generated migration scripts will be stored. Defaults to `src/main/resources/db/migration`.

fileExtension
Link copied to clipboard
@get:Input
@get:Optional
abstract val fileExtension: Property<String>

Optional file extension for migration scripts. Defaults to ".sql".

filePrefix
Link copied to clipboard
@get:Input
@get:Optional
abstract val filePrefix: Property<String>

Optional prefix for migration script names. Defaults to "V".

fileSeparator
Link copied to clipboard
@get:Input
@get:Optional
abstract val fileSeparator: Property<String>

Optional separator for migration script names. Defaults to "__".

fileVersionFormat
Link copied to clipboard
@get:Input
@get:Optional
abstract val fileVersionFormat: Property<VersionFormat>

Optional version format for migration script names. Defaults to using the full current timestamp (with seconds) in the format YYYYMMDDHHMMSS.

finalizedBy
Link copied to clipboard
open val finalizedBy: TaskDependency?
fullFileName
Link copied to clipboard
@get:Internal
var fullFileName: String?
group
Link copied to clipboard
open var group: String?
identityPath
Link copied to clipboard
open val identityPath: Path?
impliesSubProjects
Link copied to clipboard
open var impliesSubProjects: Boolean
inputs
Link copied to clipboard
open val inputs: TaskInputsInternal?
isCompatibleWithConfigurationCache
Link copied to clipboard
open val isCompatibleWithConfigurationCache: Boolean
isEnabled
Link copied to clipboard
@get:Internal
open var isEnabled: Boolean
isHasCustomActions
Link copied to clipboard
open val isHasCustomActions: Boolean
lifecycleDependencies
Link copied to clipboard
@get:Internal
open val lifecycleDependencies: TaskDependencyInternal?
localState
Link copied to clipboard
open val localState: TaskLocalState?
logger
Link copied to clipboard
open val logger: Logger?
logging
Link copied to clipboard
open val logging: LoggingManager?
mustRunAfter
Link copied to clipboard
open val mustRunAfter: TaskDependency?
name
Link copied to clipboard
open val name: String?
onlyIf
Link copied to clipboard
open val onlyIf: Spec<in TaskInternal?>?
outputs
Link copied to clipboard
open val outputs: TaskOutputsInternal?
path
Link copied to clipboard
open val path: String?
project
Link copied to clipboard
open val project: Project?
reasonNotToTrackState
Link copied to clipboard
open val reasonNotToTrackState: Optional<String?>?
reasonTaskIsIncompatibleWithConfigurationCache
Link copied to clipboard
open val reasonTaskIsIncompatibleWithConfigurationCache: Optional<String?>?
requiredServices
Link copied to clipboard
open val requiredServices: TaskRequiredServices?
sharedResources
Link copied to clipboard
open val sharedResources: List<ResourceLock?>?
shouldRunAfter
Link copied to clipboard
open val shouldRunAfter: TaskDependency?
standardOutputCapture
Link copied to clipboard
open val standardOutputCapture: StandardOutputCapture?
state
Link copied to clipboard
open val state: TaskStateInternal?
tablesPackage
Link copied to clipboard
@get:Input
abstract val tablesPackage: Property<String>

Package name where Exposed tables definitions are located.

taskActions
Link copied to clipboard
open val taskActions: List<InputChangesAwareTaskAction?>?
taskDependencies
Link copied to clipboard
open val taskDependencies: TaskDependencyInternal?
taskIdentity
Link copied to clipboard
open val taskIdentity: TaskIdentity<*>?
temporaryDir
Link copied to clipboard
open val temporaryDir: File?
temporaryDirFactory
Link copied to clipboard
open val temporaryDirFactory: Factory<File?>?
testContainersImageName
Link copied to clipboard
@get:Input
@get:Optional
abstract val testContainersImageName: Property<String>

Optional Docker image name for when using TestContainers to apply existing scripts before generating new ones.

timeout
Link copied to clipboard
open val timeout: Property<Duration?>?
useUpperCaseDescription
Link copied to clipboard
@get:Input
@get:Optional
abstract val useUpperCaseDescription: Property<Boolean>

Optional flag for whether the descriptive part of migration script names should be all in upper-case. Defaults to true.

workerExecutor
Link copied to clipboard
@get:Inject
abstract val workerExecutor: WorkerExecutor

The task's executor instance that accepts submitted work.

## Functions

acceptServiceReferences
Link copied to clipboard
open fun acceptServiceReferences(serviceReferences: Set<ServiceReferenceSpec?>?)
appendParallelSafeAction
Link copied to clipboard
open fun appendParallelSafeAction(action: Action<in Task?>?)
compareTo
Link copied to clipboard
open operator fun compareTo(otherTask: Task?): Int
configure
Link copied to clipboard
open fun configure(closure: Closure<*>?): Task?
dependsOn
Link copied to clipboard
open fun dependsOn(vararg paths: Any?): Task?
doFirst
Link copied to clipboard
open fun doFirst(action: Closure<*>?): Task?
open fun doFirst(action: Action<in Task?>?): Task?
open fun doFirst(actionName: String?, action: Action<in Task?>?): Task?
doLast
Link copied to clipboard
open fun doLast(action: Closure<*>?): Task?
open fun doLast(action: Action<in Task?>?): Task?
open fun doLast(actionName: String?, action: Action<in Task?>?): Task?
doNotTrackState
Link copied to clipboard
open fun doNotTrackState(reasonNotToTrackState: String?)
finalizedBy
Link copied to clipboard
open fun finalizedBy(vararg paths: Any?): Task?
generateMigrations
Link copied to clipboard
fun generateMigrations()

Submits a GenerateMigrationsWorker work to be executed in isolated contexts.

getConvention
Link copied to clipboard
@Internal
open fun getConvention(): Convention?
hasProperty
Link copied to clipboard
open fun hasProperty(propertyName: String?): Boolean
hasTaskActions
Link copied to clipboard
open fun hasTaskActions(): Boolean
mustRunAfter
Link copied to clipboard
open fun mustRunAfter(vararg paths: Any?): Task?
notCompatibleWithConfigurationCache
Link copied to clipboard
open fun notCompatibleWithConfigurationCache(reason: String?)
onlyIf
Link copied to clipboard
open fun onlyIf(onlyIfClosure: Closure<*>?)
open fun onlyIf(spec: Spec<in Task?>?)
open fun onlyIf(onlyIfReason: String?, spec: Spec<in Task?>?)
prependParallelSafeAction
Link copied to clipboard
open fun prependParallelSafeAction(action: Action<in Task?>?)
property
Link copied to clipboard
open fun property(propertyName: String?): Any?
setDependsOn
Link copied to clipboard
open fun setDependsOn(dependsOn: Iterable<*>?)
setFinalizedBy
Link copied to clipboard
open fun setFinalizedBy(finalizedByTasks: Iterable<*>?)
setFullFileName
Link copied to clipboard
fun setFullFileName(name: String)

Optional command line argument that overrides any filename configurations declared in the build file. Passing an argument to this option means all migration statements will be stored in a single generated file with the specified name, which should include the required extension as well.

setMustRunAfter
Link copied to clipboard
open fun setMustRunAfter(mustRunAfterTasks: Iterable<*>?)
setOnlyIf
Link copied to clipboard
open fun setOnlyIf(onlyIfClosure: Closure<*>?)
open fun setOnlyIf(spec: Spec<in Task?>?)
open fun setOnlyIf(onlyIfReason: String?, spec: Spec<in Task?>?)
setProperty
Link copied to clipboard
open fun setProperty(name: String?, value: Any?)
setShouldRunAfter
Link copied to clipboard
open fun setShouldRunAfter(shouldRunAfterTasks: Iterable<*>?)
shouldRunAfter
Link copied to clipboard
open fun shouldRunAfter(vararg paths: Any?): TaskDependency?
usesService
Link copied to clipboard
open fun usesService(service: Provider<out BuildService<*>?>?)