@Override public void afterPropertiesSet() throws LiquibaseException { HashMap<String,String> parameters = new HashMap<>(); String dbName = CoreResources.getField("db").replaceAll("-", "_"); parameters.put("mappingServer", "mapping_server_" + dbName); super.setChangeLogParameters(parameters); }
@Override public void afterPropertiesSet() throws LiquibaseException { HashMap<String,String> parameters = new HashMap<>(); parameters.put("dbUser", CoreResources.getField("dbUser")); parameters.put("dbPass", CoreResources.getField("dbPass")); parameters.put("db", CoreResources.getField("db")); parameters.put("dbHost", CoreResources.getField("dbHost")); // replace all dashes with underscores to comply with app server criteria where no dashes are allowed String dbName = CoreResources.getField("db").replaceAll("-", "_"); parameters.put("mappingServer", "mapping_server_" + dbName); super.setChangeLogParameters(parameters); super.afterPropertiesSet(); } }
liquibaseChangelogParameters.put("liquibaseExternalDataChangelogPath", liquibaseDataChangelog); liquibase.setChangeLog(extendedLiquibaseChangelog); liquibase.setChangeLogParameters(liquibaseChangelogParameters); } else { liquibase.setChangeLog(defaultLiquibaseChangelog);
@Bean @DependsOn("dataSource") public SpringLiquibase liquibase() { SpringLiquibase liquibase = new SpringLiquibase(); liquibase.setDataSource(dataSource); liquibase.setChangeLog("classpath:META-INF/liquibase/application-changes.xml"); liquibase.setContexts("default"); liquibase.setDefaultSchema(databaseProperties.getJdbcSchema()); liquibase.setChangeLogParameters(createChangeLogParameters()); return liquibase;
/** * This method configures the {@link SpringLiquibase} object before running the liquibase installer. * <p> * This implementation will set the {@link SpringLiquibase} objects changelogParameters, changelog, * default schema and data source based on this {@link AcrossLiquibaseInstaller} configuration. * <p> * Extensible if you need to perform some extra configuration on the {@link SpringLiquibase} object. * * @return The configured @link SpringLiquibase} object - before {@link SpringLiquibase#afterPropertiesSet()} */ protected SpringLiquibase createSpringLiquibase() { SpringLiquibase springLiquibase = new SpringLiquibase(); springLiquibase.setChangeLogParameters( buildParameters( getSchemaConfiguration() ) ); springLiquibase.setChangeLog( getChangelog() ); if ( StringUtils.isNotEmpty( getDefaultSchema() ) ) { springLiquibase.setDefaultSchema( getDefaultSchema() ); } else if ( getSchemaConfiguration() != null ) { springLiquibase.setDefaultSchema( getSchemaConfiguration().getDefaultSchema() ); } springLiquibase.setDataSource( getDataSource() ); return springLiquibase; }