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

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open var actions: List<Action<in Task?>?>?
Link copied to clipboard
open val ant: AntBuilder?
Link copied to clipboard
@get:Internal
open val asDynamicObject: DynamicObject?
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.

Link copied to clipboard
@get:Internal
open override val convention: Convention?
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.

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.

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.

Link copied to clipboard
open val dependsOn: Set<Any?>?
Link copied to clipboard
open var description: String?
Link copied to clipboard
open val destroyables: TaskDestroyables?
Link copied to clipboard
open var didWork: Boolean
Link copied to clipboard
open var enabled: Boolean
Link copied to clipboard
open val extensions: ExtensionContainer?
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.

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

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

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

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

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

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

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.

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

Package name where Exposed tables definitions are located.

Link copied to clipboard
open val taskActions: List<InputChangesAwareTaskAction?>?
Link copied to clipboard
open val taskDependencies: TaskDependencyInternal?
Link copied to clipboard
open val taskIdentity: TaskIdentity<*>?
Link copied to clipboard
open val temporaryDir: File?
Link copied to clipboard
open val temporaryDirFactory: Factory<File?>?
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.

Link copied to clipboard
open val timeout: Property<Duration?>?
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.

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

The task's executor instance that accepts submitted work.

Functions

Link copied to clipboard
open fun acceptServiceReferences(serviceReferences: Set<ServiceReferenceSpec?>?)
Link copied to clipboard
open fun appendParallelSafeAction(action: Action<in Task?>?)
Link copied to clipboard
open operator fun compareTo(otherTask: Task?): Int
Link copied to clipboard
open fun configure(closure: Closure<*>?): Task?
Link copied to clipboard
open fun dependsOn(vararg paths: Any?): Task?
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?
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?
Link copied to clipboard
open fun doNotTrackState(reasonNotToTrackState: String?)
Link copied to clipboard
open fun finalizedBy(vararg paths: Any?): Task?
Link copied to clipboard

Submits a GenerateMigrationsWorker work to be executed in isolated contexts.

Link copied to clipboard
@Internal
open fun getConvention(): Convention?
Link copied to clipboard
open fun hasProperty(propertyName: String?): Boolean
Link copied to clipboard
Link copied to clipboard
open fun mustRunAfter(vararg paths: Any?): Task?
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?>?)
Link copied to clipboard
open fun prependParallelSafeAction(action: Action<in Task?>?)
Link copied to clipboard
open fun property(propertyName: String?): Any?
Link copied to clipboard
open fun setDependsOn(dependsOn: Iterable<*>?)
Link copied to clipboard
open fun setFinalizedBy(finalizedByTasks: Iterable<*>?)
Link copied to clipboard

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.

Link copied to clipboard
open fun setMustRunAfter(mustRunAfterTasks: Iterable<*>?)
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?>?)
Link copied to clipboard
open fun setProperty(name: String?, value: Any?)
Link copied to clipboard
open fun setShouldRunAfter(shouldRunAfterTasks: Iterable<*>?)
Link copied to clipboard
open fun shouldRunAfter(vararg paths: Any?): TaskDependency?
Link copied to clipboard
open fun usesService(service: Provider<out BuildService<*>?>?)