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

    Fields
    Modifier and Type
    Field
    Description
    protected final io.micronaut.context.ApplicationContext
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataSourceMigrationRunner(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.context.event.ApplicationEventPublisher eventPublisher, @Nullable io.micronaut.jdbc.DataSourceResolver dataSourceResolver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    onCreated(io.micronaut.context.event.BeanCreatedEvent<DataSource> event)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 context
      eventPublisher - The event publisher
      dataSourceResolver - The data source resolver
  • Method Details

    • onCreated

      public DataSource onCreated(io.micronaut.context.event.BeanCreatedEvent<DataSource> event)
      Specified by:
      onCreated in interface io.micronaut.context.event.BeanCreatedEventListener<DataSource>