Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ project.ext.externalDependency = [
'flywayCore': 'org.flywaydb:flyway-core:7.15.0',
'guava': 'com.google.guava:guava:32.0.0-jre',
'h2': 'com.h2database:h2:1.4.196',
'hikariCP': 'com.zaxxer:HikariCP:4.0.3',
'jacksonCore': 'com.fasterxml.jackson.core:jackson-core:2.17.2',
'jacksonDataBind': 'com.fasterxml.jackson.core:jackson-databind:2.17.2',
'javatuples': 'org.javatuples:javatuples:1.2',
Expand Down
1 change: 1 addition & 0 deletions dao-impl/ebean-dao/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
compile externalDependency.guava
compile externalDependency.jsonSimple
compile externalDependency.log4j
compile externalDependency.hikariCP

compileOnly externalDependency.ebeanAgent
compileOnly externalDependency.lombok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.linkedin.metadata.query.IndexGroupByCriterion;
import com.linkedin.metadata.query.IndexSortCriterion;
import com.linkedin.metadata.query.ListResultMetadata;
import com.zaxxer.hikari.HikariDataSource;
import io.ebean.EbeanServer;
import io.ebean.SqlQuery;
import io.ebean.SqlRow;
Expand Down Expand Up @@ -623,19 +624,29 @@ private String toJsonString(@Nonnull URN urn) {

@Nonnull
private SchemaEvolutionManager createSchemaEvolutionManager(@Nonnull ServerConfig serverConfig) {

String name = serverConfig.getName();
String identifier = null;

if (name != null && name.endsWith(EBEAN_SERVER_CONFIG)) {
identifier = name.substring(0, name.length() - EBEAN_SERVER_CONFIG.length());
}
String connectionUrl = null;
String username = null;
String password = null;

if (serverConfig.getDataSource() instanceof HikariDataSource) {
HikariDataSource dataSource = (HikariDataSource) serverConfig.getDataSource();
connectionUrl = dataSource.getJdbcUrl();
username = dataSource.getUsername();
password = dataSource.getPassword();
} else if (serverConfig.getDataSourceConfig() != null) {
connectionUrl = serverConfig.getDataSourceConfig().getUrl();
username = serverConfig.getDataSourceConfig().getUsername();
password = serverConfig.getDataSourceConfig().getPassword();
}

SchemaEvolutionManager.Config config = new SchemaEvolutionManager.Config(
serverConfig.getDataSourceConfig().getUrl(),
serverConfig.getDataSourceConfig().getPassword(),
serverConfig.getDataSourceConfig().getUsername(),
identifier);
SchemaEvolutionManager.Config config =
new SchemaEvolutionManager.Config(connectionUrl, password, username, identifier);

return new FlywaySchemaEvolutionManager(config);
}
Expand Down
Loading