Package io.micronaut.flyway
Class AlternativeMigrationRunner
java.lang.Object
io.micronaut.flyway.AlternativeMigrationRunner
- All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<FlywayConfigurationProperties>
,EventListener
@Singleton
public class AlternativeMigrationRunner
extends Object
implements io.micronaut.context.event.BeanCreatedEventListener<FlywayConfigurationProperties>
Run migrations when the
DataSource
is only specified in Flyway configuration and there is no Micronaut
DataSource defined.- Since:
- 1.0.0
- Author:
- James Kleeh, Iván López
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.micronaut.context.ApplicationContext
-
Constructor Summary
ConstructorDescriptionAlternativeMigrationRunner
(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.context.event.ApplicationEventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptiononCreated
(io.micronaut.context.event.BeanCreatedEvent<FlywayConfigurationProperties> event)
-
Field Details
-
applicationContext
protected final io.micronaut.context.ApplicationContext applicationContext
-
-
Constructor Details
-
AlternativeMigrationRunner
public AlternativeMigrationRunner(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.context.event.ApplicationEventPublisher eventPublisher) - Parameters:
applicationContext
- The application contexteventPublisher
- The event publisher
-
-
Method Details
-
onCreated
public FlywayConfigurationProperties onCreated(io.micronaut.context.event.BeanCreatedEvent<FlywayConfigurationProperties> event) - Specified by:
onCreated
in interfaceio.micronaut.context.event.BeanCreatedEventListener<FlywayConfigurationProperties>
-