Package io.micronaut.flyway
Class DataSourceMigrationRunner
java.lang.Object
io.micronaut.flyway.DataSourceMigrationRunner
- All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<DataSource>
,EventListener
@Singleton
public class DataSourceMigrationRunner
extends Object
implements io.micronaut.context.event.BeanCreatedEventListener<DataSource>
Run migrations when there is a
DataSource
defined for it.- Since:
- 1.0.0
- Author:
- James Kleeh, Iván López
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.micronaut.context.ApplicationContext
-
Constructor Summary
ConstructorDescriptionDataSourceMigrationRunner
(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.context.event.ApplicationEventPublisher eventPublisher, @Nullable io.micronaut.jdbc.DataSourceResolver dataSourceResolver) -
Method Summary
Modifier and TypeMethodDescriptiononCreated
(io.micronaut.context.event.BeanCreatedEvent<DataSource> event)
-
Field Details
-
applicationContext
protected final io.micronaut.context.ApplicationContext applicationContext
-
-
Constructor Details
-
DataSourceMigrationRunner
public DataSourceMigrationRunner(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.context.event.ApplicationEventPublisher eventPublisher, @Nullable @Nullable io.micronaut.jdbc.DataSourceResolver dataSourceResolver) - Parameters:
applicationContext
- The application contexteventPublisher
- The event publisherdataSourceResolver
- The data source resolver
-
-
Method Details
-
onCreated
- Specified by:
onCreated
in interfaceio.micronaut.context.event.BeanCreatedEventListener<DataSource>
-