From 761d9f7e01574c239973b4d217543167bcc468fe Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Sat, 3 Jan 2026 07:10:39 +0800
Subject: [PATCH 01/11] cleanup
---
README.md | 20 ++++++
pom.xml | 62 ++++-------------
.../org/ohdsi/webapi/DataAccessConfig.java | 17 +++--
.../org/ohdsi/webapi/cache/CacheService.java | 1 -
.../org/ohdsi/webapi/i18n/I18nController.java | 1 -
.../org/ohdsi/webapi/info/InfoService.java | 1 -
.../webapi/job/NotificationController.java | 1 -
.../webapi/reusable/ReusableController.java | 2 -
.../webapi/security/PermissionController.java | 1 -
.../service/CohortDefinitionService.java | 2 -
.../webapi/service/ConceptSetService.java | 4 +-
.../webapi/service/FeasibilityService.java | 2 -
.../ohdsi/webapi/source/SourceController.java | 1 -
.../org/ohdsi/webapi/tag/TagController.java | 2 -
.../org/ohdsi/webapi/tool/ToolController.java | 3 -
.../importer/UserImportJobController.java | 2 -
.../resources/application-broadsea.properties | 66 ++++++++++++-------
src/main/resources/application-dev.properties | 11 ++--
src/main/resources/application.properties | 15 +++--
.../1.0.0.1__schema-drop_spring_batch.sql | 10 ---
.../rollback/1.0.0.2__schema-drop_jpa.sql | 3 -
.../rollback/1.0.0.9__schema-drop_shiro.sql | 11 ----
.../webapi/test/CDMResultsServiceIT.java | 20 +++---
.../webapi/test/CohortAnalysisServiceIT.java | 4 +-
.../webapi/test/VocabularyServiceIT.java | 4 +-
.../java/org/ohdsi/webapi/test/WebApiIT.java | 35 ++++++++--
.../resources/application-test.properties | 20 +++---
27 files changed, 158 insertions(+), 163 deletions(-)
delete mode 100644 src/main/resources/db/migration/postgresql/rollback/1.0.0.1__schema-drop_spring_batch.sql
delete mode 100644 src/main/resources/db/migration/postgresql/rollback/1.0.0.2__schema-drop_jpa.sql
delete mode 100644 src/main/resources/db/migration/postgresql/rollback/1.0.0.9__schema-drop_shiro.sql
diff --git a/README.md b/README.md
index 84e6e2fd70..e617554ffa 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,26 @@ mvn clean package -DskipTests -Dpackaging.type=jar
java -jar target/WebAPI.jar --spring.profiles.active=webapi-postgresql
```
+## Database configuration (single source of truth)
+
+Set your datasource and schema once; the packaged properties reuse the shared schema key.
+
+Minimal local run example (PostgreSQL):
+
+```bash
+export WEBAPI_SCHEMA=webapi # optional; defaults to webapi
+export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/postgres
+export SPRING_DATASOURCE_USERNAME=postgres
+export SPRING_DATASOURCE_PASSWORD=your_password
+
+java -jar target/WebAPI.jar \
+ --spring.profiles.active=webapi-postgresql \
+ --datasource.ohdsi.schema=${WEBAPI_SCHEMA:-webapi}
+```
+
+Notes:
+- Batch uses a table prefix and the security datasource can be overridden if you choose a separate connection, but both are optional when you keep everything on the main datasource/schema.
+
## SAML Auth support
The following parameters are used:
diff --git a/pom.xml b/pom.xml
index 3bf51d8690..b78eceb49d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,6 @@
UTF-8
3.5.6
- 2.24.3
2.2.1
5.5.0
@@ -40,22 +39,21 @@
21
21
-
-
- com.microsoft.sqlserver.jdbc.SQLServerDriver
- jdbc:sqlserver://serverName;databaseName=databaseName
- user
- password
+
+ org.postgresql.Driver
+ jdbc:postgresql://localhost:5433/postgres?currentSchema=webapi
+ postgres
+ mypass
- sql server
- dbo
- sql server
+ postgresql
+ webapi
+ postgresql
- com.microsoft.sqlserver.jdbc.SQLServerDriver
- jdbc:sqlserver://serverName
- userWithWritePrivs
- password
- classpath:db/migration/sqlserver
+ org.postgresql.Driver
+ ${datasource.url}
+ ${datasource.username}
+ ${datasource.password}
+ classpath:db/migration/postgresql
${datasource.ohdsi.schema}
false
@@ -466,9 +464,6 @@
--add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED
--add-exports java.naming/com.sun.jndi.ldap=ALL-UNNAMED
-
- org.springframework.boot.logging.log4j2.Log4J2LoggingSystem
-
@@ -491,9 +486,6 @@
3.5.2
${skipITtests}
-
- org.springframework.boot.logging.log4j2.Log4J2LoggingSystem
-
@@ -591,26 +583,6 @@
-
- org.apache.logging.log4j
- log4j-api
- ${log4j2.version}
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j2.version}
-
-
- org.apache.logging.log4j
- log4j-web
- ${log4j2.version}
-
-
- org.apache.logging.log4j
- log4j-slf4j-impl
- ${log4j2.version}
-
org.springframework.boot
@@ -661,12 +633,6 @@
org.springframework.boot
spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-logging
-
-
@@ -691,7 +657,7 @@
org.springframework.boot
- spring-boot-starter-log4j2
+ spring-boot-starter-logging
org.springframework.boot
diff --git a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java
index 075a85b086..fa585bf6b4 100644
--- a/src/main/java/org/ohdsi/webapi/DataAccessConfig.java
+++ b/src/main/java/org/ohdsi/webapi/DataAccessConfig.java
@@ -49,14 +49,21 @@ public class DataAccessConfig {
private Properties getJPAProperties() {
Properties properties = new Properties();
- properties.setProperty("hibernate.default_schema", this.env.getProperty("spring.jpa.properties.hibernate.default_schema"));
- properties.setProperty("hibernate.dialect", this.env.getProperty("spring.jpa.properties.hibernate.dialect"));
- properties.setProperty("hibernate.generate_statistics", this.env.getProperty("spring.jpa.properties.hibernate.generate_statistics"));
- properties.setProperty("hibernate.jdbc.batch_size", this.env.getProperty("spring.jpa.properties.hibernate.jdbc.batch_size"));
- properties.setProperty("hibernate.order_inserts", this.env.getProperty("spring.jpa.properties.hibernate.order_inserts"));
+ // Only set optional Hibernate properties when present to avoid null values
+ putIfPresent(properties, "hibernate.default_schema", this.env.getProperty("spring.jpa.properties.hibernate.default_schema"));
+ putIfPresent(properties, "hibernate.dialect", this.env.getProperty("spring.jpa.properties.hibernate.dialect"));
+ putIfPresent(properties, "hibernate.generate_statistics", this.env.getProperty("spring.jpa.properties.hibernate.generate_statistics"));
+ putIfPresent(properties, "hibernate.jdbc.batch_size", this.env.getProperty("spring.jpa.properties.hibernate.jdbc.batch_size"));
+ putIfPresent(properties, "hibernate.order_inserts", this.env.getProperty("spring.jpa.properties.hibernate.order_inserts"));
properties.setProperty("hibernate.id.new_generator_mappings", "true");
return properties;
}
+
+ private static void putIfPresent(Properties target, String key, String value) {
+ if (value != null) {
+ target.setProperty(key, value);
+ }
+ }
@Bean({"primaryDataSource", "dataSource"})
@DependsOn("defaultStringEncryptor")
diff --git a/src/main/java/org/ohdsi/webapi/cache/CacheService.java b/src/main/java/org/ohdsi/webapi/cache/CacheService.java
index e9fa67efd8..0c9e27cccd 100644
--- a/src/main/java/org/ohdsi/webapi/cache/CacheService.java
+++ b/src/main/java/org/ohdsi/webapi/cache/CacheService.java
@@ -58,7 +58,6 @@ public CacheService() {
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
public List getCacheInfoList() {
List caches = new ArrayList<>();
diff --git a/src/main/java/org/ohdsi/webapi/i18n/I18nController.java b/src/main/java/org/ohdsi/webapi/i18n/I18nController.java
index 18f27f4fd5..de95fbdf2a 100644
--- a/src/main/java/org/ohdsi/webapi/i18n/I18nController.java
+++ b/src/main/java/org/ohdsi/webapi/i18n/I18nController.java
@@ -30,7 +30,6 @@ public class I18nController {
private I18nService i18nService;
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
public Response getResources(@Context ContainerRequestContext requestContext) {
diff --git a/src/main/java/org/ohdsi/webapi/info/InfoService.java b/src/main/java/org/ohdsi/webapi/info/InfoService.java
index e822974beb..ca00fa67a6 100644
--- a/src/main/java/org/ohdsi/webapi/info/InfoService.java
+++ b/src/main/java/org/ohdsi/webapi/info/InfoService.java
@@ -52,7 +52,6 @@ public InfoService(BuildProperties buildProperties, BuildInfo buildInfo, List list(
diff --git a/src/main/java/org/ohdsi/webapi/reusable/ReusableController.java b/src/main/java/org/ohdsi/webapi/reusable/ReusableController.java
index c10a4fe0cf..80d1bcf76c 100644
--- a/src/main/java/org/ohdsi/webapi/reusable/ReusableController.java
+++ b/src/main/java/org/ohdsi/webapi/reusable/ReusableController.java
@@ -36,7 +36,6 @@ public ReusableController(ReusableService reusableService) {
}
@POST
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ReusableDTO create(final ReusableDTO dto) {
@@ -44,7 +43,6 @@ public ReusableDTO create(final ReusableDTO dto) {
}
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
public Page page(@Pagination Pageable pageable) {
return reusableService.page(pageable);
diff --git a/src/main/java/org/ohdsi/webapi/security/PermissionController.java b/src/main/java/org/ohdsi/webapi/security/PermissionController.java
index 5ab0df974e..1af1059d0f 100644
--- a/src/main/java/org/ohdsi/webapi/security/PermissionController.java
+++ b/src/main/java/org/ohdsi/webapi/security/PermissionController.java
@@ -56,7 +56,6 @@ public PermissionController(PermissionService permissionService, PermissionManag
* @return A list of permissions
*/
@GET
- @Path("")
@Produces(MediaType.APPLICATION_JSON)
public List getPermissions() {
diff --git a/src/main/java/org/ohdsi/webapi/service/CohortDefinitionService.java b/src/main/java/org/ohdsi/webapi/service/CohortDefinitionService.java
index 166ecf3992..f8823b0a37 100644
--- a/src/main/java/org/ohdsi/webapi/service/CohortDefinitionService.java
+++ b/src/main/java/org/ohdsi/webapi/service/CohortDefinitionService.java
@@ -447,7 +447,6 @@ public GenerateSqlResult generateSql(GenerateSqlRequest request) {
* @see org.ohdsi.webapi.cohortdefinition.CohortMetadataDTO
*/
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
@Cacheable(cacheNames = CachingSetup.COHORT_DEFINITION_LIST_CACHE, key = "@permissionService.getSubjectCacheKey()")
@@ -475,7 +474,6 @@ public List getCohortDefinitionList() {
* @return The newly created cohort definition
*/
@POST
- @Path("/")
@Transactional
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/org/ohdsi/webapi/service/ConceptSetService.java b/src/main/java/org/ohdsi/webapi/service/ConceptSetService.java
index eb03acc648..91d60408af 100644
--- a/src/main/java/org/ohdsi/webapi/service/ConceptSetService.java
+++ b/src/main/java/org/ohdsi/webapi/service/ConceptSetService.java
@@ -173,8 +173,7 @@ public ConceptSetDTO getConceptSet(@PathParam("id") final int id) {
* @summary Get all concept sets
* @return A list of all concept sets in the WebAPI database
*/
- @GET
- @Path("/")
+ @GET
@Produces(MediaType.APPLICATION_JSON)
@Cacheable(cacheNames = ConceptSetService.CachingSetup.CONCEPT_SET_LIST_CACHE, key = "@permissionService.getSubjectCacheKey()")
public Collection getConceptSets() {
@@ -491,7 +490,6 @@ public Response exportConceptSetToCSV(@PathParam("id") final String id) throws E
* @param conceptSetDTO The concept set to save
* @return The concept set saved with the concept set identifier
*/
- @Path("/")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/org/ohdsi/webapi/service/FeasibilityService.java b/src/main/java/org/ohdsi/webapi/service/FeasibilityService.java
index f22d08d3ca..9235f00930 100644
--- a/src/main/java/org/ohdsi/webapi/service/FeasibilityService.java
+++ b/src/main/java/org/ohdsi/webapi/service/FeasibilityService.java
@@ -385,7 +385,6 @@ public FeasibilityStudyDTO feasibilityStudyToDTO(FeasibilityStudy study) {
* @return List
*/
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
public List getFeasibilityStudyList() {
@@ -416,7 +415,6 @@ public List getFeasibilityStudyList
* @return Feasibility study
*/
@PUT
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Transactional
diff --git a/src/main/java/org/ohdsi/webapi/source/SourceController.java b/src/main/java/org/ohdsi/webapi/source/SourceController.java
index 5617382747..27466d7d5c 100644
--- a/src/main/java/org/ohdsi/webapi/source/SourceController.java
+++ b/src/main/java/org/ohdsi/webapi/source/SourceController.java
@@ -153,7 +153,6 @@ public SourceDetails getSourceDetails(@PathParam("sourceId") Integer sourceId) {
* @return a new SourceInfo for the created source
* @throws Exception
*/
- @Path("")
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/org/ohdsi/webapi/tag/TagController.java b/src/main/java/org/ohdsi/webapi/tag/TagController.java
index 9d4f8c3e84..53dd0ac497 100644
--- a/src/main/java/org/ohdsi/webapi/tag/TagController.java
+++ b/src/main/java/org/ohdsi/webapi/tag/TagController.java
@@ -40,7 +40,6 @@ public TagController(TagService pathwayService,
* @return
*/
@POST
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public TagDTO create(final TagDTO dto) {
@@ -70,7 +69,6 @@ public List search(@QueryParam("namePart") String namePart) {
* @return
*/
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
public List list() {
return tagService.listInfoDTO();
diff --git a/src/main/java/org/ohdsi/webapi/tool/ToolController.java b/src/main/java/org/ohdsi/webapi/tool/ToolController.java
index 34b2449b0c..774d8b8b80 100644
--- a/src/main/java/org/ohdsi/webapi/tool/ToolController.java
+++ b/src/main/java/org/ohdsi/webapi/tool/ToolController.java
@@ -24,7 +24,6 @@ public ToolController(ToolServiceImpl service) {
}
@GET
- @Path("")
@Produces(MediaType.APPLICATION_JSON)
public List getTools() {
return service.getTools();
@@ -38,7 +37,6 @@ public ToolDTO getToolById(@PathParam("id") Integer id) {
}
@POST
- @Path("")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ToolDTO createTool(ToolDTO dto) {
@@ -53,7 +51,6 @@ public void delete(@PathParam("id") Integer id) {
}
@PUT
- @Path("")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ToolDTO updateTool(ToolDTO toolDTO) {
diff --git a/src/main/java/org/ohdsi/webapi/user/importer/UserImportJobController.java b/src/main/java/org/ohdsi/webapi/user/importer/UserImportJobController.java
index 4c6c02f2a5..cec7d74d4b 100644
--- a/src/main/java/org/ohdsi/webapi/user/importer/UserImportJobController.java
+++ b/src/main/java/org/ohdsi/webapi/user/importer/UserImportJobController.java
@@ -55,7 +55,6 @@ public UserImportJobController(UserImportJobService jobService, @Qualifier("conv
* @return The job information
*/
@POST
- @Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public UserImportJobDTO createJob(UserImportJobDTO jobDTO) {
@@ -100,7 +99,6 @@ public UserImportJobDTO updateJob(@PathParam("id") Long jobId, UserImportJobDTO
* @return The list of user import jobs
*/
@GET
- @Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
public List listJobs() {
diff --git a/src/main/resources/application-broadsea.properties b/src/main/resources/application-broadsea.properties
index 3b6596e4b6..c3c66d0d7f 100644
--- a/src/main/resources/application-broadsea.properties
+++ b/src/main/resources/application-broadsea.properties
@@ -1,34 +1,44 @@
-# Broadsea PostgreSQL Configuration
-datasource.driverClassName=org.postgresql.Driver
-datasource.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=webapi
-datasource.username=postgres
-datasource.password=mypass
-datasource.dialect=postgresql
-datasource.ohdsi.schema=webapi
-datasource.dialect.source=postgresql
-
-# Flyway Configuration
-flyway.datasource.driverClassName=org.postgresql.Driver
-flyway.datasource.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=webapi
-flyway.datasource.username=postgres
-flyway.datasource.password=mypass
-flyway.schemas=webapi
-flyway.placeholders.ohdsiSchema=webapi
-flyway.locations=classpath:db/migration/postgresql
-flyway.validateOnMigrate=false
+# Broadsea PostgreSQL Configuration (define once, reused below)
+broadsea.db.driver=org.postgresql.Driver
+broadsea.db.url=jdbc:postgresql://localhost:5433/postgres?currentSchema=webapi_test
+broadsea.db.username=postgres
+broadsea.db.password=mypass
+broadsea.db.schema=webapi_test
+broadsea.db.dialect=postgresql
+
+datasource.driverClassName=${broadsea.db.driver}
+datasource.url=${broadsea.db.url}
+datasource.username=${broadsea.db.username}
+datasource.password=${broadsea.db.password}
+datasource.dialect=${broadsea.db.dialect}
+datasource.ohdsi.schema=${broadsea.db.schema}
+datasource.dialect.source=${broadsea.db.dialect}
+
+# Flyway Configuration (reuse primary datasource) - keep literal values to avoid SQL Server defaults
+spring.flyway.enabled=true
+spring.flyway.driver-class-name=org.postgresql.Driver
+spring.flyway.url=${broadsea.db.url}
+spring.flyway.user=${broadsea.db.username}
+spring.flyway.password=${broadsea.db.password}
+spring.flyway.locations=classpath:db/migration/postgresql
+spring.flyway.schemas=${broadsea.db.schema}
+spring.flyway.placeholders.ohdsiSchema=${broadsea.db.schema}
+spring.flyway.validate-on-migrate=false
+spring.flyway.baseline-on-migrate=true
+spring.flyway.baseline-version=0
+spring.flyway.out-of-order=true
# Hibernate Configuration
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
# JPA Configuration
spring.jpa.show-sql=false
-spring.jpa.properties.hibernate.default_schema=webapi
+spring.jpa.properties.hibernate.default_schema=${broadsea.db.schema}
spring.jpa.properties.hibernate.generate_statistics=false
spring.jpa.properties.hibernate.jdbc.batch_size=20
spring.jpa.properties.hibernate.order_inserts=true
# Spring Batch Configuration
-spring.batch.repository.tableprefix=webapi.BATCH_
+spring.batch.repository.tableprefix=${broadsea.db.schema}.BATCH_
spring.batch.repository.isolationLevelForCreate=ISOLATION_DEFAULT
spring.batch.taskExecutor.corePoolSize=5
spring.batch.taskExecutor.maxPoolSize=10
@@ -37,7 +47,7 @@ spring.batch.taskExecutor.threadGroupName=batchGroup
spring.batch.taskExecutor.threadNamePrefix=batchExec
# Server Configuration
-server.port=8080
+server.port=8081
# Security Configuration
security.provider=DisabledSecurity
@@ -47,6 +57,13 @@ security.token.expiration=43200
security.defaultGlobalReadPermissions=true
security.ssl.enabled=false
+# Security data source defaults to Postgres (matches primary)
+security.db.datasource.driverClassName=${broadsea.db.driver}
+security.db.datasource.url=${broadsea.db.url}
+security.db.datasource.username=${broadsea.db.username}
+security.db.datasource.password=${broadsea.db.password}
+security.db.datasource.schema=${broadsea.db.schema}
+
# Hikari Configuration
spring.datasource.hikari.connection-test-query=SELECT 1
spring.datasource.hikari.connection-test-query-timeout=1000
@@ -66,7 +83,10 @@ logging.level.org.ohdsi=INFO
logging.level.org.springframework.jdbc=DEBUG
# Spring Cache
-spring.cache.type=none
+spring.cache.type=simple
+
+# Disable LDAP auto-config for JDK module restrictions in this env
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration,org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
# Person Settings
person.viewDates=false
diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties
index 90730ac51c..8745c1e335 100644
--- a/src/main/resources/application-dev.properties
+++ b/src/main/resources/application-dev.properties
@@ -10,11 +10,11 @@ datasource.dialect.source=postgresql
# Flyway Configuration (Spring Boot 3.x properties)
spring.flyway.driver-class-name=org.postgresql.Driver
-spring.flyway.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=webapi_dev
-spring.flyway.user=postgres
-spring.flyway.password=mypass
-spring.flyway.schemas=webapi_dev
-spring.flyway.placeholders.ohdsiSchema=webapi_dev
+spring.flyway.url=${datasource.url}
+spring.flyway.user=${datasource.username}
+spring.flyway.password=${datasource.password}
+spring.flyway.schemas=${datasource.ohdsi.schema}
+spring.flyway.placeholders.ohdsiSchema=${datasource.ohdsi.schema}
spring.flyway.locations=classpath:db/migration/postgresql
spring.flyway.validate-on-migrate=false
spring.flyway.baseline-on-migrate=true
@@ -28,7 +28,6 @@ secondary.datasource.username=postgres
secondary.datasource.password=mypass
# Hibernate Configuration
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
# JPA Configuration
spring.jpa.show-sql=false
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 2a2537d2d8..93f9162695 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -34,9 +34,9 @@ r.serviceHost=${r.serviceHost}
#DataSource for Change Managment / Migration
spring.flyway.enabled=true
spring.flyway.driver-class-name=${datasource.driverClassName}
-spring.flyway.url=${flyway.datasource.url}
-spring.flyway.user=${flyway.datasource.username}
-spring.flyway.password=${flyway.datasource.password}
+spring.flyway.url=${datasource.url}
+spring.flyway.user=${datasource.username}
+spring.flyway.password=${datasource.password}
# CRITICAL: Maintain backward compatibility with Flyway 4.x schema history table name
spring.flyway.table=schema_version
# check that migration scripts location exists
@@ -44,7 +44,7 @@ spring.flyway.fail-on-missing-locations=true
spring.flyway.locations=${flyway.locations}
# locations of migrations scripts
# schemas to manage/update (e.g. ohdsi/results schema) -NOTE: CASE SENSITIVE!
-spring.flyway.schemas=${flyway.schemas}
+spring.flyway.schemas=${datasource.ohdsi.schema}
#Baseline - start flyway managment with existing objects
spring.flyway.baseline-on-migrate=true
#Due to issue https://github.com/flyway/flyway/issues/752 use default baselineVersion=1 (Note equality to 1.0.0.0, so scripts with that version will be omitted)
@@ -53,7 +53,7 @@ spring.flyway.validate-on-migrate=${flyway.validateOnMigrate}
# Enable out of order migrations due to distributed development nature of WebAPI
spring.flyway.out-of-order=true
# Flyway Placeholders:
-spring.flyway.placeholders.ohdsiSchema=${flyway.placeholders.ohdsiSchema}
+spring.flyway.placeholders.ohdsiSchema=${datasource.ohdsi.schema}
#Disable any auto init
#http://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html
@@ -62,12 +62,13 @@ spring.datasource.initialize=false
spring.jpa.show-sql=${spring.jpa.show-sql}
# JPA Default Schema
spring.jpa.properties.hibernate.default_schema=${datasource.ohdsi.schema}
-#JPA Dialect
-spring.jpa.properties.hibernate.dialect=${hibernate.dialect}
spring.jpa.properties.hibernate.generate_statistics=${spring.jpa.properties.hibernate.generate_statistics}
spring.jpa.properties.hibernate.jdbc.batch_size=${spring.jpa.properties.hibernate.jdbc.batch_size}
spring.jpa.properties.hibernate.order_inserts=${spring.jpa.properties.hibernate.order_inserts}
+#Jersey WADL disabled to silence missing JAXBContext warning
+jersey.config.server.wadl.disableWadl=true
+
#Spring Cache
spring.cache.jcache.config=classpath:appCache.xml
spring.cache.type=${spring.cache.type}
diff --git a/src/main/resources/db/migration/postgresql/rollback/1.0.0.1__schema-drop_spring_batch.sql b/src/main/resources/db/migration/postgresql/rollback/1.0.0.1__schema-drop_spring_batch.sql
deleted file mode 100644
index b0410dfb64..0000000000
--- a/src/main/resources/db/migration/postgresql/rollback/1.0.0.1__schema-drop_spring_batch.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_CONTEXT;
-DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_CONTEXT;
-DROP TABLE IF EXISTS BATCH_STEP_EXECUTION;
-DROP TABLE IF EXISTS BATCH_JOB_EXECUTION_PARAMS;
-DROP TABLE IF EXISTS BATCH_JOB_EXECUTION;
-DROP TABLE IF EXISTS BATCH_JOB_INSTANCE;
-
-DROP SEQUENCE IF EXISTS BATCH_STEP_EXECUTION_SEQ ;
-DROP SEQUENCE IF EXISTS BATCH_JOB_EXECUTION_SEQ ;
-DROP SEQUENCE IF EXISTS BATCH_JOB_SEQ ;
\ No newline at end of file
diff --git a/src/main/resources/db/migration/postgresql/rollback/1.0.0.2__schema-drop_jpa.sql b/src/main/resources/db/migration/postgresql/rollback/1.0.0.2__schema-drop_jpa.sql
deleted file mode 100644
index bc4189800c..0000000000
--- a/src/main/resources/db/migration/postgresql/rollback/1.0.0.2__schema-drop_jpa.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DROP TABLE IF EXISTS EXAMPLEAPP_WIDGET;
-
-DROP SEQUENCE IF EXISTS HIBERNATE_SEQUENCE ;
\ No newline at end of file
diff --git a/src/main/resources/db/migration/postgresql/rollback/1.0.0.9__schema-drop_shiro.sql b/src/main/resources/db/migration/postgresql/rollback/1.0.0.9__schema-drop_shiro.sql
deleted file mode 100644
index 34a85b13ad..0000000000
--- a/src/main/resources/db/migration/postgresql/rollback/1.0.0.9__schema-drop_shiro.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-DROP TABLE SEC_ROLE_PERMISSION;
-DROP TABLE SEC_USER_ROLE;
-DROP TABLE SEC_PERMISSION;
-DROP TABLE SEC_ROLE;
-DROP TABLE SEC_USER;
-
-DROP SEQUENCE SEC_ROLE_PERMISSION_SEQUENCE;
-DROP SEQUENCE SEC_USER_ROLE_SEQUENCE;
-DROP SEQUENCE SEC_PERMISSION_SEQUENCE;
-DROP SEQUENCE SEC_ROLE_SEQUENCE;
-DROP SEQUENCE SEC_USER_SEQUENCE;
\ No newline at end of file
diff --git a/src/test/java/org/ohdsi/webapi/test/CDMResultsServiceIT.java b/src/test/java/org/ohdsi/webapi/test/CDMResultsServiceIT.java
index bf3b63655f..9e1be20ac2 100644
--- a/src/test/java/org/ohdsi/webapi/test/CDMResultsServiceIT.java
+++ b/src/test/java/org/ohdsi/webapi/test/CDMResultsServiceIT.java
@@ -44,8 +44,8 @@ public class CDMResultsServiceIT extends WebApiIT {
@Before
public void init() throws Exception {
- truncateTable(String.format("%s.%s", "public", "source"));
- resetSequence(String.format("%s.%s", "public", "source_sequence"));
+ truncateTable(String.format("%s.%s", getOhdsiSchema(), "source"));
+ resetSequence(String.format("%s.%s", getOhdsiSchema(), "source_sequence"));
sourceRepository.saveAndFlush(getCdmSource());
prepareCdmSchema();
prepareResultSchema();
@@ -99,7 +99,7 @@ public void achillesService_clearCache_nothingInCache_doesNothing() {
achillesService.clearCache();
// Assert
- String sql = "SELECT COUNT(*) FROM achilles_cache";
+ String sql = String.format("SELECT COUNT(*) FROM %s", qualifyOhdsiTable("achilles_cache"));
Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
assertEquals(0, count.intValue());
}
@@ -108,16 +108,16 @@ public void achillesService_clearCache_nothingInCache_doesNothing() {
public void achillesService_clearCache_somethingInCache_clearsAllRowsForSource() {
// Arrange
- String insertSqlRow1 = "INSERT INTO achilles_cache (id, source_id, cache_name, cache) VALUES (1, 1, 'cache1', 'cache1')";
+ String insertSqlRow1 = String.format("INSERT INTO %s (id, source_id, cache_name, cache) VALUES (1, 1, 'cache1', 'cache1')", qualifyOhdsiTable("achilles_cache"));
jdbcTemplate.execute(insertSqlRow1);
- String insertSqlRow2 = "INSERT INTO achilles_cache (id, source_id, cache_name, cache) VALUES (2, 1, 'cache2', 'cache2')";
+ String insertSqlRow2 = String.format("INSERT INTO %s (id, source_id, cache_name, cache) VALUES (2, 1, 'cache2', 'cache2')", qualifyOhdsiTable("achilles_cache"));
jdbcTemplate.execute(insertSqlRow2);
// Act
achillesService.clearCache();
// Assert
- String sql = "SELECT COUNT(*) FROM achilles_cache";
+ String sql = String.format("SELECT COUNT(*) FROM %s", qualifyOhdsiTable("achilles_cache"));
Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
assertEquals(0, count.intValue());
}
@@ -131,7 +131,7 @@ public void cdmCacheService_clearCache_nothingInCache_doesNothing() {
cdmCacheService.clearCache();
// Assert
- String sql = "SELECT COUNT(*) FROM cdm_cache";
+ String sql = String.format("SELECT COUNT(*) FROM %s", qualifyOhdsiTable("cdm_cache"));
Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
assertEquals(0, count.intValue());
}
@@ -140,16 +140,16 @@ public void cdmCacheService_clearCache_nothingInCache_doesNothing() {
public void cdmCacheService_clearCache_somethingInCache_clearsAllRowsForSource() {
// Arrange
- String insertSqlRow1 = "INSERT INTO cdm_cache (id, concept_id, source_id, record_count, descendant_record_count, person_count, descendant_person_count) VALUES (1, 1, 1, 100, 101, 102, 103)";
+ String insertSqlRow1 = String.format("INSERT INTO %s (id, concept_id, source_id, record_count, descendant_record_count, person_count, descendant_person_count) VALUES (1, 1, 1, 100, 101, 102, 103)", qualifyOhdsiTable("cdm_cache"));
jdbcTemplate.execute(insertSqlRow1);
- String insertSqlRow2 = "INSERT INTO cdm_cache (id, concept_id, source_id, record_count, descendant_record_count, person_count, descendant_person_count) VALUES (2, 2, 1, 200, 201, 202, 203)";
+ String insertSqlRow2 = String.format("INSERT INTO %s (id, concept_id, source_id, record_count, descendant_record_count, person_count, descendant_person_count) VALUES (2, 2, 1, 200, 201, 202, 203)", qualifyOhdsiTable("cdm_cache"));
jdbcTemplate.execute(insertSqlRow2);
// Act
cdmCacheService.clearCache();
// Assert
- String sql = "SELECT COUNT(*) FROM cdm_cache";
+ String sql = String.format("SELECT COUNT(*) FROM %s", qualifyOhdsiTable("cdm_cache"));
Integer count = jdbcTemplate.queryForObject(sql, Integer.class);
assertEquals(0, count.intValue());
}
diff --git a/src/test/java/org/ohdsi/webapi/test/CohortAnalysisServiceIT.java b/src/test/java/org/ohdsi/webapi/test/CohortAnalysisServiceIT.java
index 81b6930a42..71b762b73b 100644
--- a/src/test/java/org/ohdsi/webapi/test/CohortAnalysisServiceIT.java
+++ b/src/test/java/org/ohdsi/webapi/test/CohortAnalysisServiceIT.java
@@ -37,8 +37,8 @@ public class CohortAnalysisServiceIT extends WebApiIT {
@Before
public void init() throws Exception {
- truncateTable(String.format("%s.%s", "public", "source"));
- resetSequence(String.format("%s.%s", "public", "source_sequence"));
+ truncateTable(String.format("%s.%s", getOhdsiSchema(), "source"));
+ resetSequence(String.format("%s.%s", getOhdsiSchema(), "source_sequence"));
sourceRepository.saveAndFlush(getCdmSource());
prepareCdmSchema();
prepareResultSchema();
diff --git a/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java b/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java
index f6ae6604cd..21fb1d6206 100644
--- a/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java
+++ b/src/test/java/org/ohdsi/webapi/test/VocabularyServiceIT.java
@@ -28,8 +28,8 @@ public class VocabularyServiceIT extends WebApiIT {
@Before
public void init() throws Exception {
- truncateTable(String.format("%s.%s", "public", "source"));
- resetSequence(String.format("%s.%s", "public", "source_sequence"));
+ truncateTable(String.format("%s.%s", getOhdsiSchema(), "source"));
+ resetSequence(String.format("%s.%s", getOhdsiSchema(), "source_sequence"));
sourceRepository.saveAndFlush(getCdmSource());
prepareCdmSchema();
prepareResultSchema();
diff --git a/src/test/java/org/ohdsi/webapi/test/WebApiIT.java b/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
index 3c7cab183c..e42519d582 100644
--- a/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
+++ b/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
@@ -5,6 +5,7 @@
import com.github.springtestdbunit.DbUnitTestExecutionListener;
import com.github.springtestdbunit.annotation.DbUnitConfiguration;
+import com.github.springtestdbunit.bean.DatabaseConfigBean;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
@@ -24,6 +25,7 @@
import org.ohdsi.webapi.WebApi;
import org.ohdsi.webapi.source.Source;
import org.ohdsi.webapi.source.SourceDaimon;
+import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
@@ -52,6 +54,9 @@ public abstract class WebApiIT {
protected static final String CDM_SCHEMA_NAME = "cdm";
protected static final String RESULT_SCHEMA_NAME = "results";
+ @Value("${datasource.ohdsi.schema:public}")
+ private String ohdsiSchema;
+
private static final Collection CDM_DDL_FILE_PATHS = Arrays.asList("/cdm-postgresql-ddl.sql");
private static final Collection RESULTS_DDL_FILE_PATHS = Arrays.asList(
"/ddl/results/cohort.sql",
@@ -74,13 +79,22 @@ public abstract class WebApiIT {
@TestConfiguration
public static class DbUnitConfiguration {
- @Bean
- DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection() {
+ @Bean
+ DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection(DatabaseConfigBean dbUnitDatabaseConfig,
+ @Value("${datasource.ohdsi.schema:public}") String ohdsiSchema) {
// Use the embedded PostgreSQL datasource from ITStarter
DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection = new DatabaseDataSourceConnectionFactoryBean(ITStarter.getDataSource());
- dbUnitDatabaseConnection.setSchema("public");
+ dbUnitDatabaseConnection.setSchema(ohdsiSchema);
+ dbUnitDatabaseConnection.setDatabaseConfig(dbUnitDatabaseConfig);
return dbUnitDatabaseConnection;
}
+
+ @Bean
+ DatabaseConfigBean dbUnitDatabaseConfig() {
+ DatabaseConfigBean config = new DatabaseConfigBean();
+ config.setDatatypeFactory(new PostgresqlDataTypeFactory());
+ return config;
+ }
}
@Value("${baseUri}")
@@ -125,11 +139,22 @@ public void assertOK(ResponseEntity> entity) {
}
}
+ protected String getOhdsiSchema() {
+ return ohdsiSchema;
+ }
+
+ protected String qualifyOhdsiTable(String tableName) {
+ return String.format("%s.%s", ohdsiSchema, tableName);
+ }
+
protected void truncateTable(final String tableName) {
- jdbcTemplate.execute(String.format("TRUNCATE %s CASCADE",tableName));
+ String qualifiedName = tableName.contains(".") ? tableName : String.format("%s.%s", ohdsiSchema, tableName);
+ jdbcTemplate.execute(String.format("TRUNCATE %s CASCADE", qualifiedName));
}
+
protected void resetSequence(final String sequenceName) {
- jdbcTemplate.execute(String.format("ALTER SEQUENCE %s RESTART WITH 1", sequenceName));
+ String qualifiedName = sequenceName.contains(".") ? sequenceName : String.format("%s.%s", ohdsiSchema, sequenceName);
+ jdbcTemplate.execute(String.format("ALTER SEQUENCE %s RESTART WITH 1", qualifiedName));
}
protected Source getCdmSource() throws SQLException {
diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties
index 036d21c02e..77c4a365a4 100644
--- a/src/test/resources/application-test.properties
+++ b/src/test/resources/application-test.properties
@@ -33,21 +33,23 @@ datasource.url=jdbc:postgresql://localhost:5432/postgres
datasource.username=postgres
datasource.password=
datasource.dialect=postgresql
-datasource.ohdsi.schema=public
+datasource.ohdsi.schema=${WEBAPI_SCHEMA:public}
-spring.flyway.driver-class-name=org.postgresql.Driver
+spring.flyway.driver-class-name=${datasource.driverClassName}
# System property set by AbstractDatabaseTest with embedded Postgres URL
-spring.flyway.url=jdbc:postgresql://localhost:5432/postgres
-spring.flyway.user=postgres
-spring.flyway.password=
-spring.flyway.schemas=public
-spring.flyway.placeholders.ohdsiSchema=public
+spring.flyway.url=${datasource.url}
+spring.flyway.user=${datasource.username}
+spring.flyway.password=${datasource.password}
+spring.flyway.schemas=${datasource.ohdsi.schema}
+spring.flyway.placeholders.ohdsiSchema=${datasource.ohdsi.schema}
spring.flyway.locations=classpath:db/migration/postgresql
# CRITICAL: Maintain backward compatibility with Flyway 4.x schema history table name
spring.flyway.table=schema_version
-spring.jpa.properties.hibernate.default_schema=public
-spring.batch.repository.tableprefix=public.BATCH_
+spring.jpa.properties.hibernate.default_schema=${datasource.ohdsi.schema}
+spring.batch.repository.tableprefix=${datasource.ohdsi.schema}.BATCH_
+spring.batch.jdbc.table-prefix=${datasource.ohdsi.schema}.BATCH_
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
+jersey.config.server.wadl.disableWadl=true
security.provider=DisabledSecurity
From ab66dc8464317160006d0998f4f0571c5763171f Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Sun, 4 Jan 2026 23:14:19 +0800
Subject: [PATCH 02/11] add ci to publish docker image
---
.github/workflows/ci.yaml | 45 ++++++++++---------
Dockerfile | 8 ++--
pom.xml | 9 +++-
.../org/ohdsi/webapi/service/UserService.java | 7 ++-
.../ohdsi/webapi/trexsql/TrexSQLConfig.java | 2 -
.../trexsql/TrexSQLInstanceManager.java | 6 +++
.../webapi/trexsql/TrexSQLServletConfig.java | 19 +++++++-
7 files changed, 64 insertions(+), 32 deletions(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index bc04e30fda..5e5afe4b2e 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -9,7 +9,7 @@ on:
branches: [ master, webapi-3.0 ]
env:
- DOCKER_IMAGE: ohdsi/webapi
+ DOCKER_IMAGE: ghcr.io/${{ github.repository }}
jobs:
# Build and test the code
@@ -23,7 +23,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
@@ -47,7 +47,7 @@ jobs:
run: mvn -B -P${{ env.MAVEN_PROFILE }} test
# Check that the docker image builds correctly
- # Push to ohdsi/atlas:master for commits on master.
+ # Push to ghcr.io for commits on master or webapi-3.0.
docker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
@@ -55,7 +55,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Cache Docker layers
uses: actions/cache@v4
@@ -68,40 +68,44 @@ jobs:
# Add Docker labels and tags
- name: Docker meta
id: docker_meta
- uses: crazy-max/ghaction-docker-meta@v1
+ uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE }}
+ tags: |
+ type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }}
+ type=raw,value=3.0-dev,enable=${{ github.ref == 'refs/heads/webapi-3.0' }}
# Setup docker build environment
- name: Set up QEMU
- uses: docker/setup-qemu-action@v1
+ uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
+ uses: docker/setup-buildx-action@v3
- name: Set build parameters
id: build_params
run: |
- echo "::set-output name=sha8::${GITHUB_SHA::8}"
- if [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ github.ref }}" == "refs/heads/master" ]; then
- echo "::set-output name=push::true"
- echo "::set-output name=load::false"
- echo "::set-output name=platforms::linux/amd64,linux/arm64"
+ echo "sha8=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
+ if [ "${{ github.event_name }}" != "pull_request" ] && ( [ "${{ github.ref }}" == "refs/heads/master" ] || [ "${{ github.ref }}" == "refs/heads/webapi-3.0" ] ); then
+ echo "push=true" >> $GITHUB_OUTPUT
+ echo "load=false" >> $GITHUB_OUTPUT
+ echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
else
- echo "::set-output name=push::false"
- echo "::set-output name=load::true"
- echo "::set-output name=platforms::linux/amd64"
+ echo "push=false" >> $GITHUB_OUTPUT
+ echo "load=true" >> $GITHUB_OUTPUT
+ echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
fi
- - name: Login to DockerHub
- uses: docker/login-action@v1
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
if: steps.build_params.outputs.push == 'true'
with:
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
- password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
- uses: docker/build-push-action@v2
+ uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
@@ -113,6 +117,7 @@ jobs:
build-args: |
GIT_BRANCH=${{ steps.docker_meta.outputs.version }}
GIT_COMMIT_ID_ABBREV=${{ steps.build_params.outputs.sha8 }}
+ MAVEN_PROFILE=webapi-docker,tcache
tags: ${{ steps.docker_meta.outputs.tags }}
# Use runtime labels from docker_meta as well as fixed labels
labels: |
diff --git a/Dockerfile b/Dockerfile
index a899f7d542..c73bd311c2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM maven:3.9-eclipse-temurin-21 as builder
+FROM maven:3.9-eclipse-temurin-21 AS builder
WORKDIR /code
@@ -29,7 +29,7 @@ RUN mvn package ${MAVEN_PARAMS} \
# OHDSI WebAPI running as a Spring Boot executable JAR with Java 21
FROM index.docker.io/library/eclipse-temurin:21-jre
-MAINTAINER Lee Evans - www.ltscomputingllc.com
+LABEL maintainer="Lee Evans - www.ltscomputingllc.com"
# Any Java options to pass along, e.g. memory, garbage collection, etc.
ENV JAVA_OPTS=""
@@ -49,6 +49,4 @@ EXPOSE 8080
USER 101
# Run the executable JAR
-CMD exec java ${DEFAULT_JAVA_OPTS} ${JAVA_OPTS} \
- --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED \
- -jar WebAPI.jar
+CMD ["sh", "-c", "exec java ${DEFAULT_JAVA_OPTS} ${JAVA_OPTS} --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED -jar WebAPI.jar"]
diff --git a/pom.xml b/pom.xml
index b78eceb49d..0b0ae23d1e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -558,6 +558,11 @@
+
+ central
+ Maven Central
+ https://repo.maven.apache.org/maven2
+
ohdsi
repo.ohdsi.org
@@ -1092,7 +1097,7 @@
org.springframework.ldap
spring-ldap-core
- 2.3.2.RELEASE
+ 3.2.8
org.ohdsi
@@ -1225,7 +1230,7 @@
com.github.p-hoffmann
trexsql-ext
- v0.1.2
+ v0.1.6
diff --git a/src/main/java/org/ohdsi/webapi/service/UserService.java b/src/main/java/org/ohdsi/webapi/service/UserService.java
index 8076e8e96b..f1bae66068 100644
--- a/src/main/java/org/ohdsi/webapi/service/UserService.java
+++ b/src/main/java/org/ohdsi/webapi/service/UserService.java
@@ -17,6 +17,7 @@
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
+import org.ohdsi.webapi.trexsql.TrexSQLConfig;
/**
*
@@ -33,6 +34,9 @@ public class UserService {
@Autowired
private ApplicationEventPublisher eventPublisher;
+ @Autowired(required = false)
+ private TrexSQLConfig trexSQLConfig;
+
@Value("${security.ad.default.import.group}#{T(java.util.Collections).emptyList()}")
private List defaultRoles;
@@ -51,6 +55,7 @@ public static class User implements Comparable {
public String name;
public List permissions;
public Map> permissionIdx;
+ public Boolean trexsqlCacheEnabled;
public User() {}
@@ -116,7 +121,7 @@ public User getCurrentUser() throws Exception {
user.name = currentUser.getName();
user.permissions = convertPermissions(permissions);
user.permissionIdx = authorizer.queryUserPermissions(currentUser.getLogin()).permissions;
-
+ user.trexsqlCacheEnabled = trexSQLConfig != null && trexSQLConfig.isEnabled();
return user;
}
diff --git a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLConfig.java b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLConfig.java
index 40d3dd7dfb..2fb2b09511 100644
--- a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLConfig.java
+++ b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLConfig.java
@@ -1,7 +1,6 @@
package org.ohdsi.webapi.trexsql;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
@@ -10,7 +9,6 @@
* Configuration properties for trexsql integration.
* Maps to trexsql.* in application properties.
*/
-@Configuration
@ConfigurationProperties(prefix = "trexsql")
public class TrexSQLConfig {
diff --git a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLInstanceManager.java b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLInstanceManager.java
index 36a6997018..5c7ba9c936 100644
--- a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLInstanceManager.java
+++ b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLInstanceManager.java
@@ -80,6 +80,12 @@ private Map buildConfig() {
initConfig.put("extensions-path", config.getExtensionsPath());
}
+ if (config.getCachePath() != null && !config.getCachePath().isEmpty()) {
+ initConfig.put("cache-path", config.getCachePath());
+ }
+
+ initConfig.put("allow-unsigned-extensions", true);
+
return initConfig;
}
diff --git a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLServletConfig.java b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLServletConfig.java
index 1532ba874c..5fb95bebec 100644
--- a/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLServletConfig.java
+++ b/src/main/java/org/ohdsi/webapi/trexsql/TrexSQLServletConfig.java
@@ -3,22 +3,37 @@
import org.trex.TrexServlet;
import jakarta.servlet.http.HttpServlet;
import org.ohdsi.webapi.source.SourceRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import java.util.HashMap;
+import java.util.Map;
+
@Configuration
@ConditionalOnProperty(name = "trexsql.enabled", havingValue = "true")
+@EnableConfigurationProperties(TrexSQLConfig.class)
public class TrexSQLServletConfig {
+ private static final Logger log = LoggerFactory.getLogger(TrexSQLServletConfig.class);
+
@Bean
- public ServletRegistrationBean trexServlet(
+ public ServletRegistrationBean trexServlet(
TrexSQLInstanceManager instanceManager,
+ TrexSQLConfig trexConfig,
SourceRepository sourceRepository) {
TrexServlet servlet = new TrexServlet();
- servlet.initTrex(instanceManager.getInstance(), sourceRepository);
+ Map config = new HashMap<>();
+ String cachePath = trexConfig.getCachePath();
+ log.info("TrexSQL cache path configured as: {}", cachePath);
+ config.put("cache-path", cachePath);
+
+ servlet.initTrex(instanceManager.getInstance(), sourceRepository, config);
ServletRegistrationBean registration =
new ServletRegistrationBean<>(servlet, "/WebAPI/trexsql/*");
From e0db245007655d37d5f04578769c73f30eace912 Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 00:11:15 +0800
Subject: [PATCH 03/11] fix
---
pom.xml | 25 ++++++-
.../java/org/ohdsi/webapi/test/WebApiIT.java | 70 +++++++++++++++++++
2 files changed, 93 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0b0ae23d1e..65e619c960 100644
--- a/pom.xml
+++ b/pom.xml
@@ -344,6 +344,16 @@
**/*.properties
+
+ application-test.properties
+
+
+
+ src/test/resources
+ false
+
+ application-test.properties
+
src/test/resources
@@ -400,8 +410,19 @@
diff --git a/src/test/java/org/ohdsi/webapi/test/WebApiIT.java b/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
index e42519d582..ef73ac6280 100644
--- a/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
+++ b/src/test/java/org/ohdsi/webapi/test/WebApiIT.java
@@ -10,12 +10,17 @@
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
import com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean;
+import org.flywaydb.core.Flyway;
import org.ohdsi.webapi.common.DBMSType;
import org.ohdsi.webapi.arachne.datasource.dto.KerberosAuthMechanism;
import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
import org.junit.AfterClass;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.ohdsi.circe.helper.ResourceHelper;
@@ -57,6 +62,21 @@ public abstract class WebApiIT {
@Value("${datasource.ohdsi.schema:public}")
private String ohdsiSchema;
+ @Value("${spring.flyway.locations:classpath:db/migration/postgresql}")
+ private String flywayLocations;
+
+ @Value("${spring.flyway.table:schema_version}")
+ private String flywayTable;
+
+ @Value("${spring.flyway.baseline-on-migrate:true}")
+ private boolean flywayBaselineOnMigrate;
+
+ @Value("${spring.flyway.out-of-order:true}")
+ private boolean flywayOutOfOrder;
+
+ private static final AtomicBoolean OHDSI_SCHEMA_INITIALIZED = new AtomicBoolean(false);
+ private static final Object OHDSI_SCHEMA_LOCK = new Object();
+
private static final Collection CDM_DDL_FILE_PATHS = Arrays.asList("/cdm-postgresql-ddl.sql");
private static final Collection RESULTS_DDL_FILE_PATHS = Arrays.asList(
"/ddl/results/cohort.sql",
@@ -111,6 +131,20 @@ public static void before() throws IOException {
jdbcTemplate = new JdbcTemplate(ITStarter.getDataSource());
}
+ @Before
+ public void ensureOhdsiSchemaInitialized() {
+ if (OHDSI_SCHEMA_INITIALIZED.get()) {
+ return;
+ }
+ synchronized (OHDSI_SCHEMA_LOCK) {
+ if (OHDSI_SCHEMA_INITIALIZED.get()) {
+ return;
+ }
+ initializeOhdsiSchemaIfNeeded();
+ OHDSI_SCHEMA_INITIALIZED.set(true);
+ }
+ }
+
@AfterClass
public static void after() {
ITStarter.tearDownSubject();
@@ -208,4 +242,40 @@ private void prepareSchema(final String schemaName, final String schemaToken, fi
String ddlSql = SqlTranslate.translateSql(resultSql, DBMSType.POSTGRESQL.getOhdsiDB());
jdbcTemplate.batchUpdate(SqlSplit.splitSql(ddlSql));
}
+
+ private void initializeOhdsiSchemaIfNeeded() {
+ if (tableExists(ohdsiSchema, "source")) {
+ return;
+ }
+ runFlywayMigrationsWithPrefix("B");
+ runFlywayMigrationsWithPrefix("V");
+ }
+
+ private void runFlywayMigrationsWithPrefix(String migrationPrefix) {
+ Map placeholders = Collections.singletonMap("ohdsiSchema", ohdsiSchema);
+ Flyway.configure()
+ .dataSource(ITStarter.getDataSource())
+ .locations(resolveFlywayLocations())
+ .schemas(ohdsiSchema)
+ .table(flywayTable)
+ .baselineOnMigrate(flywayBaselineOnMigrate)
+ .outOfOrder(flywayOutOfOrder)
+ .placeholders(placeholders)
+ .sqlMigrationPrefix(migrationPrefix)
+ .load()
+ .migrate();
+ }
+
+ private String[] resolveFlywayLocations() {
+ return Arrays.stream(flywayLocations.split(","))
+ .map(String::trim)
+ .filter(location -> !location.isEmpty())
+ .toArray(String[]::new);
+ }
+
+ private boolean tableExists(String schema, String tableName) {
+ String sql = "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = ? AND table_name = ?)";
+ Boolean exists = jdbcTemplate.queryForObject(sql, Boolean.class, schema, tableName);
+ return Boolean.TRUE.equals(exists);
+ }
}
From f3fd369c1c3fa68290557b52e141b375ec81438a Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 00:18:34 +0800
Subject: [PATCH 04/11] fix
---
pom.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 65e619c960..9826156bbd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -454,8 +454,6 @@
--add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED
- ${git.branch}
- ${git.commit.id.abbrev}
${buildinfo.atlas.milestone.id}
${buildinfo.webapi.milestone.id}
${buildinfo.atlas.release.tag}
From 986a9213fc2848dc2fda8f41d8268fadacfd9f20 Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 00:25:20 +0800
Subject: [PATCH 05/11] fix
---
.github/workflows/ci.yaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 5e5afe4b2e..ff9cabde21 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -8,9 +8,6 @@ on:
pull_request:
branches: [ master, webapi-3.0 ]
-env:
- DOCKER_IMAGE: ghcr.io/${{ github.repository }}
-
jobs:
# Build and test the code
build:
@@ -57,6 +54,9 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
+ - name: Set Docker image name
+ run: echo "DOCKER_IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
+
- name: Cache Docker layers
uses: actions/cache@v4
with:
From 8ac9b7f9450e83867b7134ed0f9a94a8f997063d Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 08:42:21 +0800
Subject: [PATCH 06/11] fix
---
.github/workflows/ci.yaml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index ff9cabde21..c6b6b1dbfe 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -55,7 +55,13 @@ jobs:
- uses: actions/checkout@v4
- name: Set Docker image name
- run: echo "DOCKER_IMAGE=ghcr.io/${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
+ run: |
+ REPO="${GITHUB_REPOSITORY:-ohdsi/webapi}"
+ DOCKER_IMAGE="ghcr.io/$(echo "${REPO}" | tr '[:upper:]' '[:lower:]')"
+ echo "DOCKER_IMAGE=${DOCKER_IMAGE}" >> $GITHUB_ENV
+
+ - name: Debug Docker image name
+ run: echo "DOCKER_IMAGE=${DOCKER_IMAGE}"
- name: Cache Docker layers
uses: actions/cache@v4
From d49e3b455d75f70df709aba9bd080e837dc8023d Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 08:55:33 +0800
Subject: [PATCH 07/11] fix
---
.github/workflows/ci.yaml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index c6b6b1dbfe..1718e83bcc 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -80,6 +80,15 @@ jobs:
tags: |
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=3.0-dev,enable=${{ github.ref == 'refs/heads/webapi-3.0' }}
+ type=sha,prefix={{branch}}-
+
+ - name: Debug Docker metadata
+ run: |
+ echo "Docker metadata outputs:"
+ echo "version: ${{ steps.docker_meta.outputs.version }}"
+ echo "tags: ${{ steps.docker_meta.outputs.tags }}"
+ echo "labels: ${{ steps.docker_meta.outputs.labels }}"
+ echo "json: ${{ steps.docker_meta.outputs.json }}"
# Setup docker build environment
- name: Set up QEMU
From 6d99b71e87166bfa0def0abf169516e39f1095a4 Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 09:01:29 +0800
Subject: [PATCH 08/11] fix
---
.github/workflows/ci.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 1718e83bcc..1e8d79d5e9 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -80,7 +80,8 @@ jobs:
tags: |
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=3.0-dev,enable=${{ github.ref == 'refs/heads/webapi-3.0' }}
- type=sha,prefix={{branch}}-
+ type=sha,prefix=pr-,enable=${{ github.event_name == 'pull_request' }}
+ type=ref,event=branch,prefix=branch-,enable=${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/webapi-3.0' }}
- name: Debug Docker metadata
run: |
From da4af4e2d3edc26fd169031ba2fbe0f99ebb7831 Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Mon, 5 Jan 2026 21:15:50 +0800
Subject: [PATCH 09/11] update trexsql
---
Dockerfile | 11 +++++++++--
pom.xml | 4 ++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index c73bd311c2..c27b0c9a75 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -44,9 +44,16 @@ WORKDIR /var/lib/ohdsi/webapi
COPY --from=builder /code/opentelemetry-javaagent.jar .
COPY --from=builder /code/target/WebAPI.jar .
+# Extract TrexSQL native library from the nested JAR for proper loading
+RUN mkdir -p /tmp/trexsql && \
+ unzip -j WebAPI.jar 'BOOT-INF/lib/trexsql-ext-*.jar' -d /tmp && \
+ unzip -j /tmp/trexsql-ext-*.jar 'libtrexsql_java.so_linux_amd64' -d /tmp/trexsql 2>/dev/null || true && \
+ mv /tmp/trexsql/libtrexsql_java.so_linux_amd64 /tmp/trexsql/libtrexsql_java.so 2>/dev/null || true && \
+ rm -f /tmp/trexsql-ext-*.jar
+
EXPOSE 8080
USER 101
-# Run the executable JAR
-CMD ["sh", "-c", "exec java ${DEFAULT_JAVA_OPTS} ${JAVA_OPTS} --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED -jar WebAPI.jar"]
+# Run the executable JAR with TrexSQL native library path
+CMD ["sh", "-c", "exec java ${DEFAULT_JAVA_OPTS} ${JAVA_OPTS} -Dorg.duckdb.lib_path=/tmp/trexsql/libtrexsql_java.so --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED -jar WebAPI.jar"]
diff --git a/pom.xml b/pom.xml
index 9826156bbd..ae9698a2b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1249,7 +1249,7 @@
com.github.p-hoffmann
trexsql-ext
- v0.1.6
+ v0.1.11
@@ -1926,7 +1926,7 @@
war
- war
+ jar
From 0a9edb5b65f46a828a20802112c5b11c6f5e7430 Mon Sep 17 00:00:00 2001
From: Peter Hoffmann <954078+p-hoffmann@users.noreply.github.com>
Date: Tue, 6 Jan 2026 11:52:33 +0800
Subject: [PATCH 10/11] readd migrations for broadsea
---
Dockerfile | 5 +-
pom.xml | 24 +-
...0180807192421__cohortDetailsHashcodes.java | 29 ++
...20190410103000__migratePathwayResults.java | 181 ++++++++++++
...90520171430__cohortExpressionHashCode.java | 34 +++
..._0_20191106092815__migrateEventFAType.java | 70 +++++
.../trexsql/TrexSQLInstanceManager.java | 17 +-
.../webapi/trexsql/TrexSQLSearchProvider.java | 7 +-
.../ohdsi/webapi/trexsql/TrexSQLService.java | 2 +
src/main/resources/application.properties | 7 +-
.../ensureTables.sql | 32 ++
.../getPathwayGeneratedCodes.sql | 1 +
.../getPathwayGeneratedDesigns.sql | 5 +
.../migratePathwayResults.sql | 25 ++
.../saveCodes.sql | 2 +
.../updateFaType.sql | 3 +
.../updateFaTypeImpala.sql | 8 +
...11012325133__assets_tags_add_endpoints.sql | 26 ++
.../V2.11.0.20211101134413__reusables.sql | 129 ++++++++
.../V2.11.0.20211109155216__cdm_cache.sql | 16 +
...0218125000__add_permission_for_checkv2.sql | 9 +
...00__add_tagging_mass_assign_permission.sql | 12 +
...20719110154__add_description_to_assets.sql | 3 +
...02208110000__alter_source_cache_enable.sql | 3 +
....202208240001__concept_recommend_perms.sql | 24 ++
.../V2.12.0.20221102113317__user_originb.sql | 9 +
...alter_source_set_cache_enabled_default.sql | 1 +
...4175000__add_tag_management_permission.sql | 9 +
..._concept_set_csv_comparison_permission.sql | 7 +
...057__add_export_conceptset_permissions.sql | 20 ++
...__delete-unnecessary-admin-permissions.sql | 1 +
...V2.2.0.20180215143000__remove_password.sql | 2 +
....5.20180212152023__concept-sets-author.sql | 5 +
.../V2.2.5.20180212181325__cca-author.sql | 3 +
...2.5.20180215105415__separate-sequences.sql | 19 ++
....2.6.20180215152023__source_key_unique.sql | 1 +
....20180302143300__negative_control_redo.sql | 37 +++
....3.0.20180302143400__alter_cs_gen_info.sql | 9 +
...20180330124512__add_source_permissions.sql | 40 +++
...20180405164306__add_profile_permission.sql | 14 +
....0.20180412000000__increment_sequences.sql | 16 +
.../V2.3.0.20180412000001__constraints.sql | 8 +
...85900__cohort_analysis_generation_info.sql | 16 +
...V2.3.0.20180427114800__sec_user_unique.sql | 1 +
...4.0.20180508090000__source-credentials.sql | 2 +
.../V2.4.0.20180516223100__roles-unique.sql | 1 +
...20180619113700__permission_for_my_user.sql | 14 +
...702202700__permission_for_ir_execution.sql | 9 +
...0180703144901__permission_for_evidence.sql | 9 +
...2403__schema-add-analysis-gen-progress.sql | 1 +
.../V2.5.0.20180713123456__cem_v_1.sql | 12 +
...20117120__source-connection-check-rule.sql | 5 +
...80725172844__add-ad-import-permissions.sql | 64 ++++
...0192730__schema-add-kerberos-to-source.sql | 4 +
...17154116__add-extra-import-permissions.sql | 8 +
...0180731092421__cohort-characterization.sql | 276 ++++++++++++++++++
...hort-characterization-generations-view.sql | 27 ++
...2.6.0.20180906220021__pathway_analysis.sql | 98 +++++++
...5__migrate_common_entities_to_user_rel.sql | 77 +++++
.../V2.6.0.20180921202400__fe-analysis-id.sql | 1 +
....20181001200021__estimation_prediction.sql | 50 ++++
...0181002110845__fe_analysis_conceptsets.sql | 1 +
...005122300__schema-create-fe-conceptset.sql | 16 +
...0181008210200__source-deleted-at-field.sql | 1 +
....20181009110500__fix-fe-analysis-types.sql | 45 +++
...0181009115500__fix-ple-plp-permissions.sql | 47 +++
...1010133216__schema-add-job-is-canceled.sql | 7 +
...10185036__schema-user-import-scheduler.sql | 44 +++
...__schema-user-import-scheduler-history.sql | 23 ++
...6.0.20181015182101__role-group-mapping.sql | 10 +
...00__add_last_viewed_notifications_time.sql | 18 ++
...150353__separate_system_personal_roles.sql | 8 +
...2.6.0.20181107165252__fe_criteria_type.sql | 7 +
.../V2.6.0.20181128150100__add_missing_pk.sql | 45 +++
.../V2.7.0.20181119162154__cc_strata.sql | 29 ++
....7.0.20190116183005__default_stat_type.sql | 6 +
...25113000__fe-analysis-created-modified.sql | 5 +
...00__fe-analysis-criteria_stat-type-fix.sql | 19 ++
...0190128134827__create_absent_sequences.sql | 13 +
...3000__fe-analysis-created-modified-fix.sql | 10 +
...0.20190201090000__bjep_idx_and_cleanup.sql | 1 +
..._cc-and-pathway-cancel-job-permissions.sql | 31 ++
...190204183006__ir-cancel-job-permission.sql | 10 +
...205174343__cc-pathway-copy-permissions.sql | 23 ++
...8164736__analysis_execution-add-job_id.sql | 11 +
...tion-estimation-generation-permissions.sql | 23 ++
....7.0.20190211182000__permissions-fixes.sql | 73 +++++
...190212154939__analysis_execution_files.sql | 13 +
.../V2.7.0.201902130900__source-sequences.sql | 11 +
...0190213161124__add-fk-to-source-daimon.sql | 2 +
....0.20190214110000__permissions-fixes-2.sql | 14 +
....0.20190214145000__permissions-fixes-3.sql | 41 +++
....0.20190215113000__permissions-fixes-4.sql | 38 +++
...20113500__permissions-fixes-ir-profile.sql | 48 +++
..._permissions-fixes-source-codes-import.sql | 27 ++
...22154724__permission-fixes-conceptsets.sql | 9 +
.../V2.7.0.20190225165203__plp_gen_view.sql | 22 ++
....0.20190225165752__estimation_gen_view.sql | 22 ++
...ssions-fixes-cohort-export-conceptsets.sql | 9 +
...28160000__permissions-fixes-cc-explore.sql | 9 +
....7.0.20190301130000__cc-unique-stratas.sql | 1 +
.../V2.7.0.20190304084500__plp-ple-import.sql | 11 +
...0304131519__standardize-permissions-cc.sql | 37 +++
...0255__standardize-permissions-pathways.sql | 37 +++
...0304162609__standardize-permissions-ir.sql | 54 ++++
...13000__standardize-permissions-cohorts.sql | 10 +
...0__standardize-permissions-conceptsets.sql | 3 +
.../V2.7.0.20190304220500__role-moderator.sql | 36 +++
...05123620__ir-executioninfo-permissions.sql | 27 ++
...306094500__sources-endpoint-permission.sql | 5 +
....0.20190306154500__rename_heracles_seq.sql | 1 +
...190311152238__permissions-fixes-ir-sql.sql | 9 +
...11182048__fix_vocab_search_permissions.sql | 33 +++
...312164953__fix_permission_id_seq_value.sql | 2 +
...0190313161353__fix_permission_heracles.sql | 19 ++
...3__alter-ir-execution-status-as-string.sql | 12 +
...203__added-ir-report-perms-for-sources.sql | 21 ++
...7.1.20190405124500__split_output_files.sql | 16 +
....7.2.20190429174506__run-as_permission.sql | 7 +
....2.20190528153600__fix-ir-report-perms.sql | 27 ++
...20190905163100__cache-clear-permission.sql | 7 +
...00728164800__add_conceptset_permission.sql | 11 +
...14500__delete_design_column_from_views.sql | 91 ++++++
.../V2.8.0.20190326152000__fix-role-perms.sql | 3 +
...0326180601__add-cc-download-permission.sql | 9 +
...190405140828__cc_generation_export_all.sql | 17 ++
...14180601__add-entity-exists-permission.sql | 39 +++
...100__pathway-analysis-minSegmentLength.sql | 1 +
...ntity-exists-permission-cohort-concept.sql | 12 +
...add-unique-name-constraint-to-entities.sql | 82 ++++++
...527190601__add_cs_name_copy_permission.sql | 10 +
..._alter_job-execution-params_string-val.sql | 119 ++++++++
...604111801__ir_import_export_permission.sql | 12 +
...2.8.0.20190728224300__ds-common-entity.sql | 5 +
...V2.8.0.20190809215200__daimon-priority.sql | 9 +
...2.8.0.20190816173000__generation-cache.sql | 18 ++
...191203200000__generation-cache-updates.sql | 5 +
...9183702__migrate_feature_extraction_id.sql | 2 +
...0.20200109100200__cohort_sample_tables.sql | 23 ++
...8.0.20200109132902__fe_domain_null_fix.sql | 14 +
...3000__insert_cohort_sample_permissions.sql | 19 ++
...127101702__restore_rest_endpoint_perms.sql | 17 ++
....20200130124345__fe_analysis_aggregate.sql | 96 ++++++
....20200325145111__check_required_params.sql | 24 ++
...33802__add-ir-permission-to-atlas-user.sql | 4 +
...V2.8.0.20200413150815__gis_service_api.sql | 18 ++
....8.0.20200427161830__modify_user_login.sql | 5 +
...d_created_by_to_cohort_generation_info.sql | 2 +
...0.20200616112935__fe_check_permissions.sql | 9 +
...20200724121114__daimon-priority-public.sql | 6 +
...move-ir-put-permission-from-atlas-user.sql | 4 +
...03120903__drop-cohort-features-columns.sql | 37 +++
....202010130001__print_friendly_security.sql | 13 +
...0031__concept_ancestor_and_descendants.sql | 24 ++
...0__add_source_daimon_unique_constraint.sql | 9 +
...is_service_add_check_source_permission.sql | 8 +
...0210219100459__evidence_get_permission.sql | 14 +
...0210226100460__evidence_get_permission.sql | 11 +
.../V2.9.0.20210423125133__assets_tags.sql | 189 ++++++++++++
.../V2.9.0.20210513111520__versioning.sql | 176 +++++++++++
.../V2.9.0.20210727101117__achilles_cache.sql | 13 +
...0.20210812164224__assets_tags_renaming.sql | 9 +
162 files changed, 3887 insertions(+), 18 deletions(-)
create mode 100644 src/main/java/org/ohdsi/webapi/db/migartion/V2_6_0_20180807192421__cohortDetailsHashcodes.java
create mode 100644 src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20190410103000__migratePathwayResults.java
create mode 100644 src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20190520171430__cohortExpressionHashCode.java
create mode 100644 src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20191106092815__migrateEventFAType.java
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/ensureTables.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/getPathwayGeneratedCodes.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/getPathwayGeneratedDesigns.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/migratePathwayResults.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/saveCodes.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20191106092815__migrateEventFAType/updateFaType.sql
create mode 100644 src/main/resources/db/migration/java/V2_8_0_20191106092815__migrateEventFAType/updateFaTypeImpala.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.11.0.20211012325133__assets_tags_add_endpoints.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.11.0.20211101134413__reusables.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.11.0.20211109155216__cdm_cache.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.11.0.20220218125000__add_permission_for_checkv2.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.0.20220710161100__add_tagging_mass_assign_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.0.20220719110154__add_description_to_assets.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.0.202208110000__alter_source_cache_enable.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.0.202208240001__concept_recommend_perms.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.0.20221102113317__user_originb.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.12.1.202210120000__alter_source_set_cache_enabled_default.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.13.0.20221024175000__add_tag_management_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.13.0.20221027170000__add_concept_set_csv_comparison_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.13.1.20230524160057__add_export_conceptset_permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.0.20180202143000__delete-unnecessary-admin-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.0.20180215143000__remove_password.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.5.20180212152023__concept-sets-author.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.5.20180212181325__cca-author.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.5.20180215105415__separate-sequences.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.2.6.20180215152023__source_key_unique.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180302143300__negative_control_redo.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180302143400__alter_cs_gen_info.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180330124512__add_source_permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180405164306__add_profile_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180412000000__increment_sequences.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180412000001__constraints.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180425185900__cohort_analysis_generation_info.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.3.0.20180427114800__sec_user_unique.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.4.0.20180508090000__source-credentials.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.4.0.20180516223100__roles-unique.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.4.3.20180619113700__permission_for_my_user.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.4.3.20180702202700__permission_for_ir_execution.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.4.3.20180703144901__permission_for_evidence.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180608182403__schema-add-analysis-gen-progress.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180713123456__cem_v_1.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180720117120__source-connection-check-rule.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180725172844__add-ad-import-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180730192730__schema-add-kerberos-to-source.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.5.0.20180817154116__add-extra-import-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20180731092421__cohort-characterization.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20180731092422__cohort-characterization-generations-view.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20180906220021__pathway_analysis.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20180910113305__migrate_common_entities_to_user_rel.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20180921202400__fe-analysis-id.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181001200021__estimation_prediction.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181002110845__fe_analysis_conceptsets.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181005122300__schema-create-fe-conceptset.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181008210200__source-deleted-at-field.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181009110500__fix-fe-analysis-types.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181009115500__fix-ple-plp-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181010133216__schema-add-job-is-canceled.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181010185036__schema-user-import-scheduler.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181010185037__schema-user-import-scheduler-history.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181015182101__role-group-mapping.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181016171200__add_last_viewed_notifications_time.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181024150353__separate_system_personal_roles.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181107165252__fe_criteria_type.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.6.0.20181128150100__add_missing_pk.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20181119162154__cc_strata.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190116183005__default_stat_type.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190125113000__fe-analysis-created-modified.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190125141500__fe-analysis-criteria_stat-type-fix.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190128134827__create_absent_sequences.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190129083000__fe-analysis-created-modified-fix.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190201090000__bjep_idx_and_cleanup.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190204153542__cc-and-pathway-cancel-job-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190204183006__ir-cancel-job-permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190205174343__cc-pathway-copy-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190208164736__analysis_execution-add-job_id.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190211181105__prediction-estimation-generation-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190211182000__permissions-fixes.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190212154939__analysis_execution_files.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.201902130900__source-sequences.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190213161124__add-fk-to-source-daimon.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190214110000__permissions-fixes-2.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190214145000__permissions-fixes-3.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190215113000__permissions-fixes-4.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190220113500__permissions-fixes-ir-profile.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190222113000__permissions-fixes-source-codes-import.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190222154724__permission-fixes-conceptsets.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190225165203__plp_gen_view.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190225165752__estimation_gen_view.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190226160020__permissions-fixes-cohort-export-conceptsets.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190228160000__permissions-fixes-cc-explore.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190301130000__cc-unique-stratas.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304084500__plp-ple-import.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304131519__standardize-permissions-cc.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304160255__standardize-permissions-pathways.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304162609__standardize-permissions-ir.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304213000__standardize-permissions-cohorts.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304220000__standardize-permissions-conceptsets.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190304220500__role-moderator.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190305123620__ir-executioninfo-permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190306094500__sources-endpoint-permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190306154500__rename_heracles_seq.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190311152238__permissions-fixes-ir-sql.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190311182048__fix_vocab_search_permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190312164953__fix_permission_id_seq_value.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190313161353__fix_permission_heracles.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190314171003__alter-ir-execution-status-as-string.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.0.20190328172203__added-ir-report-perms-for-sources.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.1.20190405124500__split_output_files.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.2.20190429174506__run-as_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.2.20190528153600__fix-ir-report-perms.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.4.20190905163100__cache-clear-permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.7.8.20200728164800__add_conceptset_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190319114500__delete_design_column_from_views.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190326152000__fix-role-perms.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190326180601__add-cc-download-permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190405140828__cc_generation_export_all.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190414180601__add-entity-exists-permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190417120100__pathway-analysis-minSegmentLength.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190424140601__add-entity-exists-permission-cohort-concept.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190424150601__add-unique-name-constraint-to-entities.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190527190601__add_cs_name_copy_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190531181956__alter_job-execution-params_string-val.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190604111801__ir_import_export_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190728224300__ds-common-entity.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190809215200__daimon-priority.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20190816173000__generation-cache.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20191203200000__generation-cache-updates.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20191219183702__migrate_feature_extraction_id.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200109100200__cohort_sample_tables.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200109132902__fe_domain_null_fix.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200122173000__insert_cohort_sample_permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200127101702__restore_rest_endpoint_perms.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200130124345__fe_analysis_aggregate.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200325145111__check_required_params.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200409133802__add-ir-permission-to-atlas-user.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200413150815__gis_service_api.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200427161830__modify_user_login.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200428122109__add_created_by_to_cohort_generation_info.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200616112935__fe_check_permissions.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200724121114__daimon-priority-public.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200811155100__remove-ir-put-permission-from-atlas-user.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20200903120903__drop-cohort-features-columns.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.202010130001__print_friendly_security.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20201022120031__concept_ancestor_and_descendants.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.0.20201103171300__add_source_daimon_unique_constraint.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.1.20210203163300__gis_service_add_check_source_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.1.20210219100459__evidence_get_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.8.1.20210226100460__evidence_get_permission.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.9.0.20210423125133__assets_tags.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.9.0.20210513111520__versioning.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.9.0.20210727101117__achilles_cache.sql
create mode 100644 src/main/resources/db/migration/postgresql/V2.9.0.20210812164224__assets_tags_renaming.sql
diff --git a/Dockerfile b/Dockerfile
index c27b0c9a75..e3d98cc282 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@ FROM maven:3.9-eclipse-temurin-21 AS builder
WORKDIR /code
-ARG MAVEN_PROFILE=webapi-docker
+ARG MAVEN_PROFILE=webapi-docker,tcache
ARG MAVEN_PARAMS="" # can use maven options, e.g. -DskipTests=true -DskipUnitTests=true
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=1.17.0
@@ -41,10 +41,11 @@ ENV DEFAULT_JAVA_OPTS="-Djava.security.egd=file:///dev/./urandom"
# set working directory to a fixed WebAPI directory
WORKDIR /var/lib/ohdsi/webapi
+RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
+
COPY --from=builder /code/opentelemetry-javaagent.jar .
COPY --from=builder /code/target/WebAPI.jar .
-# Extract TrexSQL native library from the nested JAR for proper loading
RUN mkdir -p /tmp/trexsql && \
unzip -j WebAPI.jar 'BOOT-INF/lib/trexsql-ext-*.jar' -d /tmp && \
unzip -j /tmp/trexsql-ext-*.jar 'libtrexsql_java.so_linux_amd64' -d /tmp/trexsql 2>/dev/null || true && \
diff --git a/pom.xml b/pom.xml
index ae9698a2b5..2a955e8bc1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -497,6 +497,10 @@
-parameters
+
+
+ **/trexsql/**
+
@@ -1246,11 +1250,6 @@
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
-
- com.github.p-hoffmann
- trexsql-ext
- v0.1.11
-
@@ -1259,8 +1258,23 @@
true
+
+
+ com.github.p-hoffmann
+ trexsql-ext
+ v0.1.15
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+
+
+
org.springframework.boot
spring-boot-maven-plugin
diff --git a/src/main/java/org/ohdsi/webapi/db/migartion/V2_6_0_20180807192421__cohortDetailsHashcodes.java b/src/main/java/org/ohdsi/webapi/db/migartion/V2_6_0_20180807192421__cohortDetailsHashcodes.java
new file mode 100644
index 0000000000..422daa9f14
--- /dev/null
+++ b/src/main/java/org/ohdsi/webapi/db/migartion/V2_6_0_20180807192421__cohortDetailsHashcodes.java
@@ -0,0 +1,29 @@
+package org.ohdsi.webapi.db.migartion;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.ohdsi.webapi.arachne.commons.config.flyway.ApplicationContextAwareSpringMigration;
+import java.util.List;
+import org.ohdsi.webapi.cohortdefinition.CohortDefinitionDetails;
+import org.ohdsi.webapi.cohortdefinition.CohortDefinitionDetailsRepository;
+
+/**
+ * Flyway Java migration to update hash codes for cohort definition details.
+ *
+ * Note: NOT a @Component - Flyway discovers this via classpath scanning.
+ * Dependencies are retrieved from ApplicationContext to avoid circular dependency issues.
+ */
+public class V2_6_0_20180807192421__cohortDetailsHashcodes extends ApplicationContextAwareSpringMigration {
+
+ @Override
+ public void migrate() throws JsonProcessingException {
+ // Get repository from Spring ApplicationContext (set by Flyway before migration runs)
+ CohortDefinitionDetailsRepository detailsRepository =
+ applicationContext.getBean(CohortDefinitionDetailsRepository.class);
+
+ final List allDetails = detailsRepository.findAll();
+ for (CohortDefinitionDetails details: allDetails) {
+ details.updateHashCode();
+ detailsRepository.save(details);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20190410103000__migratePathwayResults.java b/src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20190410103000__migratePathwayResults.java
new file mode 100644
index 0000000000..bc29310f52
--- /dev/null
+++ b/src/main/java/org/ohdsi/webapi/db/migartion/V2_8_0_20190410103000__migratePathwayResults.java
@@ -0,0 +1,181 @@
+package org.ohdsi.webapi.db.migartion;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import org.ohdsi.webapi.arachne.commons.config.flyway.ApplicationContextAwareSpringMigration;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.json.JSONObject;
+import org.ohdsi.circe.helper.ResourceHelper;
+import org.ohdsi.sql.SqlRender;
+import org.ohdsi.sql.SqlSplit;
+import org.ohdsi.sql.SqlTranslate;
+import org.ohdsi.webapi.service.AbstractDaoService;
+import org.ohdsi.webapi.source.Source;
+import org.ohdsi.webapi.source.SourceDaimon;
+import org.ohdsi.webapi.source.SourceRepository;
+import org.ohdsi.webapi.util.CancelableJdbcTemplate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.jdbc.core.PreparedStatementCreator;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import static org.ohdsi.webapi.Constants.Params.GENERATION_ID;
+
+/**
+ * Flyway Java migration to migrate pathway analysis results.
+ *
+ * Note: NOT a @Component - Flyway discovers this via classpath scanning.
+ * Dependencies are retrieved from ApplicationContext to avoid circular dependency issues.
+ */
+public class V2_8_0_20190410103000__migratePathwayResults extends ApplicationContextAwareSpringMigration {
+
+ private final static String SQL_PATH = "/db/migration/java/V2_8_0_20190410103000__migratePathwayResults/";
+ private static final Logger log = LoggerFactory.getLogger(V2_8_0_20190410103000__migratePathwayResults.class);
+
+ @Service
+ public static class MigrationDAO extends AbstractDaoService {
+
+ public void savePathwayCodes(List