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..6da63badc7e --- /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 + */ + +-- 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 +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..80f18c031fa --- /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 + */ + +-- 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 +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