From f9bfa26788096bac4d21ea1b926b4c7600ea1859 Mon Sep 17 00:00:00 2001 From: XingY Date: Tue, 1 Sep 2026 16:47:52 -0700 Subject: [PATCH 1/2] GitHub Issue 1499: SpecialCharacterMetricsMaintenanceTask is throwing exceptions on specimen tables --- .../dbscripts/postgresql/study-26.000-26.001.sql | 14 ++++++++++++++ .../dbscripts/sqlserver/study-26.000-26.001.sql | 14 ++++++++++++++ study/src/org/labkey/study/StudyModule.java | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql create mode 100644 study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql diff --git a/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql b/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql new file mode 100644 index 00000000000..c0dbcba5cba --- /dev/null +++ b/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ + +-- Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column +UPDATE exp.propertydescriptor +SET storagecolumnname = exp.propertydescriptor.name +FROM exp.propertydomain pdm, exp.domaindescriptor dd +WHERE pdm.propertyid = exp.propertydescriptor.propertyid + AND dd.domainid = pdm.domainid + AND LOWER(dd.storageschemaname) = 'specimentables' + AND LOWER(exp.propertydescriptor.storagecolumnname) = LOWER(exp.propertydescriptor.name) || '1'; diff --git a/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql b/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql new file mode 100644 index 00000000000..a2c0f9eca02 --- /dev/null +++ b/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ + +-- Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column +UPDATE exp.propertydescriptor +SET storagecolumnname = exp.propertydescriptor.name +FROM exp.propertydomain pdm, exp.domaindescriptor dd +WHERE pdm.propertyid = exp.propertydescriptor.propertyid + AND dd.domainid = pdm.domainid + AND LOWER(dd.storageschemaname) = 'specimentables' + AND LOWER(exp.propertydescriptor.storagecolumnname) = LOWER(exp.propertydescriptor.name) + '1'; diff --git a/study/src/org/labkey/study/StudyModule.java b/study/src/org/labkey/study/StudyModule.java index 8200f035965..7a9c20748c3 100644 --- a/study/src/org/labkey/study/StudyModule.java +++ b/study/src/org/labkey/study/StudyModule.java @@ -229,7 +229,7 @@ public String getName() @Override public Double getSchemaVersion() { - return 26.000; + return 26.001; } @Override From dd5543ca2b4d4616adde6eb01e9dd8fbfd06c49d Mon Sep 17 00:00:00 2001 From: XingY Date: Thu, 3 Sep 2026 11:46:41 -0700 Subject: [PATCH 2/2] add comment --- .../schemas/dbscripts/postgresql/study-26.000-26.001.sql | 2 +- .../schemas/dbscripts/sqlserver/study-26.000-26.001.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql b/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql index c0dbcba5cba..6da63badc7e 100644 --- a/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql +++ b/study/resources/schemas/dbscripts/postgresql/study-26.000-26.001.sql @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ --- Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column +-- GitHub Issue 1499: Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column UPDATE exp.propertydescriptor SET storagecolumnname = exp.propertydescriptor.name FROM exp.propertydomain pdm, exp.domaindescriptor dd diff --git a/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql b/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql index a2c0f9eca02..80f18c031fa 100644 --- a/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql +++ b/study/resources/schemas/dbscripts/sqlserver/study-26.000-26.001.sql @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ --- Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column +-- GitHub Issue 1499: Reset specimen base-column storage names that were uniquified with a numeric suffix but never became a physical column UPDATE exp.propertydescriptor SET storagecolumnname = exp.propertydescriptor.name FROM exp.propertydomain pdm, exp.domaindescriptor dd