首页>代码>Spring Boot整合Flyway框架实现自动新建mysql数据库表,并且插入、删除数据>/springboot-flyway/src/main/java/com/hellokoding/springboot/jpa/Application.java
package com.hellokoding.springboot.jpa; import com.hellokoding.springboot.jpa.book.BookRepository; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @SpringBootApplication @Slf4j class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } @Bean public CommandLineRunner runner(BookRepository repository) { return r -> log.info(repository.findAll().toString()); } }