Spring Boot 1.4: Executing Method after Liquibase finished

后端 未结 2 1048

I have a Spring Boot 1.4.0 based Project that uses Liquibase.

Is it possible to execute a Method AFTER liquibase finished?

Something like Bean Post Processor?

2条回答
  •  生来不讨喜
    2021-02-20 06:59

    Another solution would be to let LiquiBase insert these things into your database - but only when running in dev-mode.

    You can do this in LiquiBase by specifying a context="" attribute.

    Another option would be to let LiquiBase only insert this test-data into your database when dbms="h2db" (forgot what the exact string is to select h2, check documentation please!)

    Both are attributes on changesets.

    This is my own preferred solution for this kind of scenarios.

提交回复
热议问题