Skip to content

Instantly share code, notes, and snippets.

@Romeh
Created March 6, 2019 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Romeh/f4d4a24573d243ed73f5c12ef54f1f7d to your computer and use it in GitHub Desktop.
Save Romeh/f4d4a24573d243ed73f5c12ef54f1f7d to your computer and use it in GitHub Desktop.
@Bean
public SpringLiquibase springLiquibase(DataSource dataSource) throws SQLException {
// here we create the schema first if not yet created before
tryToCreateSchema(dataSource);
SpringLiquibase liquibase = new SpringLiquibase();
// we want to drop the datasbe if it was created before to have immutable version
liquibase.setDropFirst(true);
liquibase.setDataSource(dataSource);
//you set the schema name which will be used into ur integration test
liquibase.setDefaultSchema("test");
// the classpath reference for your liquibase changlog
liquibase.setChangeLog("classpath:/db/changelog/changelog-master.xml");
return liquibase;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment