diff --git a/elisa/module.properties b/elisa/module.properties index 2a5159677..e9ebf95ea 100644 --- a/elisa/module.properties +++ b/elisa/module.properties @@ -6,5 +6,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/elisa/resources/schemas/dbscripts/sqlserver/elisa-0.000-23.000.sql b/elisa/resources/schemas/dbscripts/sqlserver/elisa-0.000-23.000.sql deleted file mode 100644 index 8aab5fa3c..000000000 --- a/elisa/resources/schemas/dbscripts/sqlserver/elisa-0.000-23.000.sql +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2020-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -CREATE SCHEMA elisa; -GO - -CREATE TABLE elisa.CurveFit -( - RowId INT IDENTITY (1, 1) NOT NULL, - Container ENTITYID NOT NULL, - Created DATETIME NOT NULL, - CreatedBy USERID NOT NULL, - Modified DATETIME NOT NULL, - ModifiedBy USERID NOT NULL, - - RunId INT NOT NULL, - ProtocolId INT NOT NULL, - PlateName NVARCHAR(250), - Spot INT, - RSquared DOUBLE PRECISION, - FitParameters NVARCHAR(500), - - CONSTRAINT PK_CurveFit PRIMARY KEY (RowId), - CONSTRAINT FK_CurveFit_ProtocolId FOREIGN KEY (ProtocolId) REFERENCES exp.Protocol (RowId), - CONSTRAINT FK_CurveFit_ExperimentRun FOREIGN KEY (RunId) - REFERENCES exp.ExperimentRun (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION -); -GO - -CREATE INDEX IX_CurveFit_ProtocolId ON elisa.CurveFit(ProtocolId); -CREATE INDEX IX_CurveFit_RunId ON elisa.CurveFit(RunId); diff --git a/elispotassay/module.properties b/elispotassay/module.properties index 92f19d997..a68b52383 100644 --- a/elispotassay/module.properties +++ b/elispotassay/module.properties @@ -13,5 +13,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-0.00-18.30.sql b/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-0.00-18.30.sql deleted file mode 100644 index e3408081c..000000000 --- a/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-0.00-18.30.sql +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -CREATE SCHEMA elispotlk; -GO -CREATE SCHEMA elispotantigen; -GO - -CREATE TABLE elispotlk.rundata -( - RowId INT IDENTITY (1, 1) NOT NULL, - RunId INT NOT NULL, - SpecimenLsid LSIDtype NOT NULL, - AntigenLsid LSIDtype, - SpotCount REAL, - WellgroupName NVARCHAR(4000), - WellgroupLocation NVARCHAR(4000), - NormalizedSpotCount REAL, - AntigenWellgroupName NVARCHAR(4000), - Analyte NVARCHAR(4000), - Activity DOUBLE PRECISION, - Intensity DOUBLE PRECISION, - - ObjectUri NVARCHAR(300), - ObjectId INT NOT NULL, - - CONSTRAINT pk_elispot_rundata PRIMARY KEY (RowId), - CONSTRAINT fk_elispotrundata_experimentrun FOREIGN KEY (RunId) - REFERENCES exp.experimentrun (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT fk_elispotrundata_specimenlsid FOREIGN KEY (SpecimenLsid) - REFERENCES exp.material (LSID) - ON UPDATE NO ACTION ON DELETE NO ACTION -); - -CREATE INDEX idx_elispotrundata_runid ON elispotlk.rundata(RunId); - -ALTER TABLE elispotlk.rundata ADD Cytokine NVARCHAR(4000); -ALTER TABLE elispotlk.rundata ADD SpotSize REAL; diff --git a/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-25.000-25.001.sql b/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-25.000-25.001.sql deleted file mode 100644 index ec66f23d5..000000000 --- a/elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-25.000-25.001.sql +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - --- Drop unused column -ALTER TABLE elispotlk.rundata DROP COLUMN ObjectId; diff --git a/elispotassay/src/org/labkey/elispot/query/ElispotRunAntigenTable.java b/elispotassay/src/org/labkey/elispot/query/ElispotRunAntigenTable.java index 4f1495a3c..0a3d105b3 100644 --- a/elispotassay/src/org/labkey/elispot/query/ElispotRunAntigenTable.java +++ b/elispotassay/src/org/labkey/elispot/query/ElispotRunAntigenTable.java @@ -42,10 +42,7 @@ public ElispotRunAntigenTable(final AssaySchema schema, ContainerFilter cf, fina // Add column for AntigenStats heading SQLFragment sql = new SQLFragment("CASE WHEN AntigenName IS NULL OR AntigenName = AntigenWellgroupName THEN AntigenWellgroupName ELSE "); - if (getSqlDialect().isPostgreSQL()) - sql.append("AntigenName || ' (' || SUBSTRING(AntigenWellgroupName, 9) || ')' END"); - else - sql.append("CONCAT(AntigenName, ' (', REPLACE(AntigenWellgroupName, 'Antigen ', ''), ')') END"); + sql.append("AntigenName || ' (' || SUBSTRING(AntigenWellgroupName, 9) || ')' END"); ExprColumn antigenHeading = new ExprColumn(this, "AntigenHeading", sql, JdbcType.VARCHAR, getColumn("AntigenWellgroupName"), getColumn("AntigenName")); antigenHeading.setHidden(true); diff --git a/flow/module.properties b/flow/module.properties index ae8c1e613..815b2c8f5 100644 --- a/flow/module.properties +++ b/flow/module.properties @@ -9,5 +9,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/flow/resources/schemas/dbscripts/sqlserver/flow-0.000-22.000.sql b/flow/resources/schemas/dbscripts/sqlserver/flow-0.000-22.000.sql deleted file mode 100644 index 6efbed8b7..000000000 --- a/flow/resources/schemas/dbscripts/sqlserver/flow-0.000-22.000.sql +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2016-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* flow-0.00-11.30.sql */ - -CREATE SCHEMA flow; -GO - -CREATE TABLE flow.Attribute -( - RowId INT IDENTITY(1,1) NOT NULL, - Name NVARCHAR(256) COLLATE Latin1_General_BIN NOT NULL, - - CONSTRAINT PK_Attribute PRIMARY KEY (RowId), - CONSTRAINT UQ_Attribute UNIQUE(Name) -); - -CREATE TABLE flow.Object -( - RowId INT IDENTITY(1,1) NOT NULL, - Container ENTITYID NOT NULL, - DataId INT, - TypeId INT NOT NULL, - Uri VARCHAR(400), - CompId INT, - ScriptId INT, - FcsId INT, - - CONSTRAINT PK_Object PRIMARY KEY (RowId), - CONSTRAINT UQ_Object UNIQUE(DataId), - CONSTRAINT FK_Object_Data FOREIGN KEY(DataId) REFERENCES exp.Data(RowId) -); -CREATE INDEX flow_object_typeid ON flow.object (container, typeid); - -CREATE TABLE flow.Keyword -( - ObjectId INT NOT NULL, - KeywordId INT NOT NULL, - Value NTEXT, - - CONSTRAINT PK_Keyword PRIMARY KEY CLUSTERED (ObjectId, KeywordId), - CONSTRAINT FK_Keyword_Object FOREIGN KEY(ObjectId) REFERENCES flow.Object(RowId), - CONSTRAINT FK_Keyword_Attribute FOREIGN KEY (KeywordId) REFERENCES flow.Attribute(RowId) -); - -CREATE TABLE flow.Statistic -( - ObjectId INT NOT NULL, - StatisticId INT NOT NULL, - Value FLOAT NOT NULL, - - CONSTRAINT PK_Statistic PRIMARY KEY CLUSTERED (ObjectId, StatisticId), - CONSTRAINT FK_Statistic_Object FOREIGN KEY (ObjectId) REFERENCES flow.Object(RowId), - CONSTRAINT FK_Statistic_Attribute FOREIGN KEY (StatisticId) REFERENCES flow.Attribute(RowId) -); - -CREATE TABLE flow.Graph -( - RowId INT IDENTITY(1,1) NOT NULL, - ObjectId INT NOT NULL, - GraphId INT NOT NULL, - Data IMAGE, - - CONSTRAINT PK_Graph PRIMARY KEY(RowId), - CONSTRAINT UQ_Graph UNIQUE(ObjectId, GraphId), - CONSTRAINT FK_Graph_Object FOREIGN KEY (ObjectId) REFERENCES flow.Object(RowId), - CONSTRAINT FK_Graph_Attribute FOREIGN KEY (GraphId) REFERENCES flow.Attribute(RowId) -); - -CREATE TABLE flow.Script -( - RowId INT IDENTITY(1,1) NOT NULL, - ObjectId INT NOT NULL, - Text NTEXT, - - CONSTRAINT PK_Script PRIMARY KEY(RowId), - CONSTRAINT UQ_Script UNIQUE(ObjectId), - CONSTRAINT FK_Script_Object FOREIGN KEY (ObjectId) REFERENCES flow.Object(RowId) -); - -/** - * the query to find the in use statistic/graph/keyword ids is way too expensive - * so keep track of the in us attributes per container/type - * - * there three tables are basically a materialized view over flow.Object and - * the respective data table (statistic,keyword,graph) - */ - -CREATE TABLE flow.StatisticAttr -( - container ENTITYID NOT NULL, - id INT NOT NULL, - CONSTRAINT "PK_StatistiAttr" UNIQUE (container, id) -) -go - -INSERT INTO flow.StatisticAttr (container, id) -SELECT DISTINCT OBJ.container, PROP.statisticid AS id -FROM flow.object OBJ INNER JOIN flow.statistic PROP ON OBJ.rowid = PROP.objectid -go - -CREATE TABLE flow.KeywordAttr -( - container ENTITYID NOT NULL, - id INT NOT NULL, - CONSTRAINT "PK_KeywordAttr" UNIQUE (container, id) -) -go - -INSERT INTO flow.KeywordAttr (container, id) -SELECT DISTINCT OBJ.container, PROP.keywordid AS id -FROM flow.object OBJ INNER JOIN - flow.keyword PROP ON OBJ.rowid = PROP.objectid -go - - - -CREATE TABLE flow.GraphAttr -( - container ENTITYID NOT NULL, - id INT NOT NULL, - CONSTRAINT "PK_GraphAttr" UNIQUE (container, id) -) -go - -INSERT INTO flow.GraphAttr (container, id) -SELECT DISTINCT OBJ.container, PROP.graphid AS id -FROM flow.object OBJ INNER JOIN - flow.graph PROP ON OBJ.rowid = PROP.objectid -go - --- KeywordAttr ------------------ - --- Add RowId and Name to KeywordAttr -ALTER TABLE flow.KeywordAttr - ADD RowId INT IDENTITY(1,1) NOT NULL, - Name NVARCHAR(256); - -GO - -ALTER TABLE flow.KeywordAttr DROP CONSTRAINT "PK_KeywordAttr"; -ALTER TABLE flow.KeywordAttr ADD CONSTRAINT PK_KeywordAttr PRIMARY KEY (RowId); - --- Copy 'Attribute.Name' into 'KeywordAttr.Name' -UPDATE flow.KeywordAttr - SET Name = Attribute.Name - FROM flow.Attribute - WHERE Attribute.RowId = KeywordAttr.Id; - -ALTER TABLE flow.KeywordAttr ALTER COLUMN Name NVARCHAR(256) NOT NULL; -ALTER TABLE flow.KeywordAttr ADD CONSTRAINT UQ_KeywordAttr UNIQUE (Container, Name); - --- Drop the PK_Keyword for the next update and add it again afterwards. -ALTER TABLE flow.Keyword DROP CONSTRAINT PK_Keyword; -ALTER TABLE flow.Keyword DROP CONSTRAINT FK_Keyword_Attribute; - --- Change 'Keyword.KeywordId' to point at 'KeywordAttr.RowId' -UPDATE flow.Keyword -SET KeywordId = - (SELECT KeywordAttr.RowId FROM flow.KeywordAttr, flow.Object - WHERE KeywordAttr.Id = Keyword.KeywordId - AND KeywordAttr.Container = Object.Container - AND Object.RowId = Keyword.ObjectId); - --- Correct PK_Keyword will be added in flow-11.19-11.191 script ---ALTER TABLE flow.Keyword ADD CONSTRAINT PK_Keyword UNIQUE (ObjectId, KeywordId); -ALTER TABLE flow.Keyword ADD CONSTRAINT FK_Keyword_KeywordAttr FOREIGN KEY (KeywordId) REFERENCES flow.KeywordAttr (RowId); - --- Change meaning of 'KeywordAttr.Id' from FK Attribute.RowId to self KeywordAttr.RowId and equal to Keyword.KeywordId --- When KeywordAttr.Id == RowId, the Name column is the preferred name otherwise it is an alias. -UPDATE flow.KeywordAttr SET Id = RowId; - - --- StatisticAttr ------------------ - --- Add RowId and Name to StatisticAttr -ALTER TABLE flow.StatisticAttr - ADD RowId INT IDENTITY(1,1) NOT NULL, - Name NVARCHAR(256); - -GO - -ALTER TABLE flow.StatisticAttr DROP CONSTRAINT "PK_StatistiAttr"; -ALTER TABLE flow.StatisticAttr ADD CONSTRAINT PK_StatisticAttr PRIMARY KEY (RowId); - --- Copy 'Attribute.Name' into 'StatisticAttr.Name' -UPDATE flow.StatisticAttr - SET Name = Attribute.Name - FROM flow.Attribute - WHERE Attribute.RowId = StatisticAttr.Id; - -ALTER TABLE flow.StatisticAttr ALTER COLUMN Name NVARCHAR(256) NOT NULL; -ALTER TABLE flow.StatisticAttr ADD CONSTRAINT UQ_StatisticAttr UNIQUE (Container, Name); - --- Drop the PK_Statistic for the next update and add it again afterwards. -ALTER TABLE flow.Statistic DROP CONSTRAINT PK_Statistic; -ALTER TABLE flow.Statistic DROP CONSTRAINT FK_Statistic_Attribute; - --- Change 'Statistic.StatisticId' to point at 'StatisticAttr.RowId' -UPDATE flow.Statistic -SET StatisticId = - (SELECT StatisticAttr.RowId FROM flow.StatisticAttr, flow.Object - WHERE StatisticAttr.Id = Statistic.StatisticId - AND StatisticAttr.Container = Object.Container - AND Object.RowId = Statistic.ObjectId); - --- Correct PK_Statistic will be added in flow-11.19-11.191 script ---ALTER TABLE flow.Statistic ADD CONSTRAINT PK_Statistic UNIQUE (ObjectId, StatisticId); -ALTER TABLE flow.Statistic ADD CONSTRAINT FK_Statistic_StatisticAttr FOREIGN KEY (StatisticId) REFERENCES flow.StatisticAttr (RowId); - --- Change meaning of 'StatisticAttr.Id' from FK Attribute.RowId to self StatisticAttr.RowId and equal to Statistic.StatisticId --- When StatisticAttr.Id == RowId, the Name column is the preferred name otherwise it is an alias. -UPDATE flow.StatisticAttr SET Id = RowId; - - --- GraphAttr ------------------ - --- Add RowId and Name to GraphAttr -ALTER TABLE flow.GraphAttr - ADD RowId INT IDENTITY(1,1) NOT NULL, - Name NVARCHAR(256); - -GO - -ALTER TABLE flow.GraphAttr DROP CONSTRAINT "PK_GraphAttr"; -ALTER TABLE flow.GraphAttr ADD CONSTRAINT PK_GraphAttr PRIMARY KEY (RowId); - --- Copy 'Attribute.Name' into 'GraphAttr.Name' -UPDATE flow.GraphAttr - SET Name = Attribute.Name - FROM flow.Attribute - WHERE Attribute.RowId = GraphAttr.Id; - -ALTER TABLE flow.GraphAttr ALTER COLUMN Name NVARCHAR(256) NOT NULL; -ALTER TABLE flow.GraphAttr ADD CONSTRAINT UQ_GraphAttr UNIQUE (Container, Name); - --- Drop the PK_Graph for the next update and add it again afterwards. -ALTER TABLE flow.Graph DROP CONSTRAINT PK_Graph; -ALTER TABLE flow.Graph DROP CONSTRAINT UQ_Graph; -ALTER TABLE flow.Graph DROP CONSTRAINT FK_Graph_Attribute; - --- Change 'Graph.GraphId' to point at 'GraphAttr.RowId' -UPDATE flow.Graph -SET GraphId = - (SELECT GraphAttr.RowId FROM flow.GraphAttr, flow.Object - WHERE GraphAttr.Id = Graph.GraphId - AND GraphAttr.Container = Object.Container - AND Object.RowId = Graph.ObjectId); - --- Correct PK_Graph will be added in flow-11.19-11.191 script ---ALTER TABLE flow.Graph ADD CONSTRAINT PK_Graph UNIQUE (ObjectId, GraphId); -ALTER TABLE flow.Graph ADD CONSTRAINT FK_Graph_GraphAttr FOREIGN KEY (GraphId) REFERENCES flow.GraphAttr (RowId); - --- Change meaning of 'GraphAttr.Id' from FK Attribute.RowId to self GraphAttr.RowId and equal to Graph.GraphId --- When GraphAttr.Id == RowId, the Name column is the preferred name otherwise it is an alias. -UPDATE flow.GraphAttr SET Id = RowId; - --- Change 'PK_*' unique constraints to actually be primary key constraint. -EXEC core.fn_dropifexists 'Keyword', 'flow', 'constraint', 'PK_Keyword'; -ALTER TABLE flow.Keyword ADD CONSTRAINT PK_Keyword PRIMARY KEY CLUSTERED (ObjectId, KeywordId); - -EXEC core.fn_dropifexists 'Statistic', 'flow', 'constraint', 'PK_Statistic'; -ALTER TABLE flow.Statistic ADD CONSTRAINT PK_Statistic PRIMARY KEY CLUSTERED (ObjectId, StatisticId); - -ALTER TABLE flow.Graph DROP COLUMN rowid; -EXEC core.fn_dropifexists 'Graph', 'flow', 'constraint', 'PK_Graph'; -EXEC core.fn_dropifexists 'Graph', 'flow', 'constraint', 'UQ_Graph'; -ALTER TABLE flow.Graph ADD CONSTRAINT PK_Graph PRIMARY KEY CLUSTERED (ObjectId, GraphId); - --- flow.Attribute table no longer used -EXEC core.fn_dropifexists 'Attribute', 'flow', 'TABLE', NULL; - --- removed obsolete DELETE statement that cleaned up orphaned exp.data objects - -/* flow-12.30-13.10.sql */ - -CREATE INDEX IX_Keyword_KeywordId ON flow.Keyword (KeywordId); -CREATE INDEX IX_Statistic_StatisticId ON flow.Statistic (StatisticId); -CREATE INDEX IX_Graph_GraphId ON flow.Graph (GraphId); - -/* flow-13.10-13.20.sql */ - --- Drop the NOT NULL constraint on the keyword value column -ALTER TABLE flow.keyword ALTER COLUMN value NTEXT NULL; -GO - --- Keyword values are trimmed to null on import as of r27096. -UPDATE flow.keyword -SET value = NULL -WHERE 0 = LEN(LTRIM(RTRIM(CAST(value AS NVARCHAR(MAX))))); - -/* flow-14.10-14.20.sql */ - --- add original keyword id -ALTER TABLE flow.keyword - ADD OriginalKeywordId INT; - -GO - --- copy keywordid to originalkeywordid, then update keywordid to the preferred keywordattr.id -UPDATE flow.keyword SET OriginalKeywordId = KeywordId; -UPDATE flow.keyword SET KeywordId = ( - SELECT id FROM flow.keywordattr WHERE flow.keywordattr.rowid = keywordid -); - -ALTER TABLE flow.keyword - ALTER COLUMN OriginalKeywordId INT NOT NULL; - -ALTER TABLE flow.keyword - ADD CONSTRAINT FK_Keyword_OriginalKeywordId FOREIGN KEY (OriginalKeywordId) REFERENCES flow.keywordattr (rowid); - - --- add original statistic id -ALTER TABLE flow.statistic - ADD OriginalStatisticId INT; - -GO - --- copy statisticid to originalstatisticid, then update statisticid to the preferred statisticattr.id -UPDATE flow.statistic SET OriginalStatisticId = StatisticId; -UPDATE flow.statistic SET StatisticId = ( - SELECT id FROM flow.statisticattr WHERE flow.statisticattr.rowid = statisticid -); - -ALTER TABLE flow.statistic - ALTER COLUMN OriginalStatisticId INT NOT NULL; - -ALTER TABLE flow.statistic - ADD CONSTRAINT FK_Statistic_OriginalStatisticId FOREIGN KEY (OriginalStatisticId) REFERENCES flow.statisticattr (rowid); - - --- add original graph id -ALTER TABLE flow.graph - ADD OriginalGraphId INT; - -GO - --- copy graphid to originalgraphid, then update graphid to the preferred graphattr.id -UPDATE flow.graph SET OriginalGraphId = GraphId; -UPDATE flow.graph SET GraphId = ( - SELECT id FROM flow.graphattr WHERE flow.graphattr.rowid = graphid -); - -ALTER TABLE flow.graph - ALTER COLUMN OriginalGraphId INT NOT NULL; - -ALTER TABLE flow.graph - ADD CONSTRAINT FK_Statistic_OriginalGraphId FOREIGN KEY (OriginalGraphId) REFERENCES flow.graphattr (rowid); - -/* flow-18.30-19.10.sql */ - -UPDATE flow.object SET uri = 'file:///' + substring(uri, 7, 400) WHERE uri LIKE 'file:/_%' AND uri NOT LIKE 'file:///%' AND uri IS NOT NULL; - -/* 21.xxx SQL scripts */ - -ALTER TABLE flow.StatisticAttr ALTER COLUMN Name NVARCHAR(400) NOT NULL; -ALTER TABLE flow.GraphAttr ALTER COLUMN Name NVARCHAR(400) NOT NULL; -GO \ No newline at end of file diff --git a/flow/src/org/labkey/flow/persist/FlowManager.java b/flow/src/org/labkey/flow/persist/FlowManager.java index 07720058d..baa513e8c 100644 --- a/flow/src/org/labkey/flow/persist/FlowManager.java +++ b/flow/src/org/labkey/flow/persist/FlowManager.java @@ -212,14 +212,7 @@ private FlowEntry getAttributeEntryCaseSensitive(String containerId, AttributeTy SQLFragment sql = new SQLFragment("SELECT Name, RowId, Id FROM ") .append(attributeTable(type)) .append(" WHERE Container = ?").add(containerId); - if (FlowManager.get().getSchema().getSqlDialect().isSqlServer()) - { - sql.append(" AND cast(Name AS VARBINARY(512)) = cast(? AS VARBINARY(512))").add(attr); - } - else - { - sql.append(" AND Name = ?").add(attr); - } + sql.append(" AND Name = ?").add(attr); try (ResultSet rs = new SqlSelector(getSchema(), sql).getResultSet()) { diff --git a/flow/src/org/labkey/flow/persist/PersistTests.java b/flow/src/org/labkey/flow/persist/PersistTests.java index 9ba19d640..6db39dd22 100644 --- a/flow/src/org/labkey/flow/persist/PersistTests.java +++ b/flow/src/org/labkey/flow/persist/PersistTests.java @@ -23,7 +23,6 @@ import org.labkey.api.data.SimpleFilter; import org.labkey.api.data.SqlSelector; import org.labkey.api.data.Table; -import org.labkey.api.data.TableResultSet; import org.labkey.api.data.TableSelector; import org.labkey.api.exp.api.ExpData; import org.labkey.api.exp.api.ExperimentService; @@ -562,13 +561,12 @@ public void caseInsensitiveNames() throws Exception assertTrue(protocol.isCaseSensitiveKeywords()); assertFalse(protocol.isCaseSensitiveStatsAndGraphs()); - final boolean sqlserver = FlowManager.get().getSchema().getSqlDialect().isSqlServer(); final String UPPER_NAME = "CASE-TEST"; final String lower_name = "case-test"; // setup -- legacy databases may have existing attribute names which differ in casing int upperId; - int lowerId = -1; + int lowerId; { Map map = Table.insert(user, FlowManager.get().getTinfoKeywordAttr(), CaseInsensitiveHashMap.of( @@ -581,20 +579,17 @@ public void caseInsensitiveNames() throws Exception map.put("Id", upperId); Table.update(user, FlowManager.get().getTinfoKeywordAttr(), map, upperId); - // Insert a duplicate name that only differs by case (NOTE: SQLServer default collation won't allow this) - if (!sqlserver) - { - map = Table.insert( user, FlowManager.get().getTinfoKeywordAttr(), - CaseInsensitiveHashMap.of( - "Container", c.getId(), - "Name", lower_name, - "Id", -1)); - lowerId = asInteger(map.get("RowId")); - - // Set the Id column to indicate that it is not an alias - map.put("Id", lowerId); - Table.update(user, FlowManager.get().getTinfoKeywordAttr(), map, lowerId); - } + // Insert a duplicate name that only differs by case + map = Table.insert( user, FlowManager.get().getTinfoKeywordAttr(), + CaseInsensitiveHashMap.of( + "Container", c.getId(), + "Name", lower_name, + "Id", -1)); + lowerId = asInteger(map.get("RowId")); + + // Set the Id column to indicate that it is not an alias + map.put("Id", lowerId); + Table.update(user, FlowManager.get().getTinfoKeywordAttr(), map, lowerId); } // verify -- attribute cache is case-insensitive @@ -621,13 +616,10 @@ public void caseInsensitiveNames() throws Exception assertEquals(UPPER_NAME, ke2.getAttribute()); assertEquals(upperId, ke2.getRowId()); - if (!sqlserver) - { - AttributeCache.KeywordEntry ke1 = AttributeCache.KEYWORDS.byRowId(c, lowerId); - assertNotNull(ke1); - assertEquals(lower_name, ke1.getAttribute()); - assertEquals(lowerId, ke1.getRowId()); - } + AttributeCache.KeywordEntry ke1 = AttributeCache.KEYWORDS.byRowId(c, lowerId); + assertNotNull(ke1); + assertEquals(lower_name, ke1.getAttribute()); + assertEquals(lowerId, ke1.getRowId()); } // verify -- can't insert new attribute names that differ by case @@ -641,10 +633,7 @@ public void caseInsensitiveNames() throws Exception assertThat(ex.getMessage(), containsString("Sample TEST: Can't create keyword with same casing as other keywords. Existing keyword")); assertThat(ex.getMessage(), containsString("with different casing from the requested name 'CaSe-TeSt':")); assertThat(ex.getMessage(), containsString(UPPER_NAME + " (id=" + upperId)); - if (!sqlserver) - { - assertThat(ex.getMessage(), containsString(lower_name + " (id=" + lowerId)); - } + assertThat(ex.getMessage(), containsString(lower_name + " (id=" + lowerId)); } // verify -- can't insert alias that differs only by case @@ -661,28 +650,22 @@ public void caseInsensitiveNames() throws Exception assertThat(ex.getMessage(), containsString("Existing keyword")); assertThat(ex.getMessage(), containsString("with different casing from the requested name 'CaSe-TeSt':")); assertThat(ex.getMessage(), containsString(UPPER_NAME + " (id=" + upperId)); - if (!sqlserver) - { - assertThat(ex.getMessage(), containsString(lower_name + " (id=" + lowerId)); - } + assertThat(ex.getMessage(), containsString(lower_name + " (id=" + lowerId)); } // verify -- allow insert alias that differs only by case if allowCaseChangeAlias is true - if (!sqlserver) - { - AttributeCache.KeywordEntry ke1 = AttributeCache.KEYWORDS.byName(c, UPPER_NAME); - assertNotNull(ke1); - assertTrue(ke1.getAliases().isEmpty()); - - FlowManager.get().ensureAlias(AttributeType.keyword, ke1.getRowId(), "CaSe-TeSt", true, true, true); - - ke1 = AttributeCache.KEYWORDS.byName(c, UPPER_NAME); - Collection aliases = ke1.getAliases(); - assertEquals(1, aliases.size()); - AttributeCache.KeywordEntry alias = aliases.iterator().next(); - assertEquals("CaSe-TeSt", alias.getName()); - assertEquals(ke1, alias.getAliasedEntry()); - } + AttributeCache.KeywordEntry ke1 = AttributeCache.KEYWORDS.byName(c, UPPER_NAME); + assertNotNull(ke1); + assertTrue(ke1.getAliases().isEmpty()); + + FlowManager.get().ensureAlias(AttributeType.keyword, ke1.getRowId(), "CaSe-TeSt", true, true, true); + + ke1 = AttributeCache.KEYWORDS.byName(c, UPPER_NAME); + Collection aliases = ke1.getAliases(); + assertEquals(1, aliases.size()); + AttributeCache.KeywordEntry alias = aliases.iterator().next(); + assertEquals("CaSe-TeSt", alias.getName()); + assertEquals(ke1, alias.getAliasedEntry()); } @Test diff --git a/flow/src/org/labkey/flow/query/GraphForeignKey.java b/flow/src/org/labkey/flow/query/GraphForeignKey.java index 2ed5b5f12..008a9d5ae 100644 --- a/flow/src/org/labkey/flow/query/GraphForeignKey.java +++ b/flow/src/org/labkey/flow/query/GraphForeignKey.java @@ -86,10 +86,6 @@ protected SQLFragment sqlValue(ColumnInfo objectIdColumn, GraphSpec attrName, in dialect.concatenate(new SQLFragment("'" + GraphColumn.SEP + "'"), new SQLFragment("?").add(attrName.toString())); SQLFragment objectIdSql = objectIdColumn.getValueSql(ExprColumn.STR_TABLE_ALIAS); - if (dialect.isSqlServer()) - { - objectIdSql = new SQLFragment("CAST(").append(objectIdSql).append(" AS NVARCHAR(100))"); - } SQLFragment sql = new SQLFragment("(SELECT CASE WHEN COUNT(flow.Graph.ObjectId) = 1"); sql.append("\nTHEN "); diff --git a/flow/src/org/labkey/flow/query/KeywordForeignKey.java b/flow/src/org/labkey/flow/query/KeywordForeignKey.java index 5864600c6..c47be6afa 100644 --- a/flow/src/org/labkey/flow/query/KeywordForeignKey.java +++ b/flow/src/org/labkey/flow/query/KeywordForeignKey.java @@ -71,8 +71,6 @@ protected void initColumn(String attrName, String preferredName, BaseColumnInfo @Override protected SQLFragment sqlValue(ColumnInfo objectIdColumn, String attrName, int attrId) { - // SQL server 2000 does not allow a TEXT column (i.e. flow.keyword.value) to appear in this subquery. - // For this reason, we cast it to VARCHAR(4000). SQLFragment ret = new SQLFragment("(SELECT CAST(flow.Keyword.Value AS VARCHAR(4000)) FROM flow.Keyword WHERE flow.Keyword.ObjectId = "); ret.append(objectIdColumn.getValueSql(ExprColumn.STR_TABLE_ALIAS)); ret.append(" AND flow.Keyword.KeywordId = "); diff --git a/luminex/module.properties b/luminex/module.properties index 6ff86db7d..a37bb1c64 100644 --- a/luminex/module.properties +++ b/luminex/module.properties @@ -10,5 +10,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/luminex/resources/schemas/dbscripts/sqlserver/luminex-0.000-23.000.sql b/luminex/resources/schemas/dbscripts/sqlserver/luminex-0.000-23.000.sql deleted file mode 100644 index 050ad3b02..000000000 --- a/luminex/resources/schemas/dbscripts/sqlserver/luminex-0.000-23.000.sql +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2024-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -CREATE SCHEMA luminex; -GO - -CREATE TABLE luminex.Analyte -( - RowId INT IDENTITY(1,1) NOT NULL, - LSID LSIDtype NOT NULL , - Name VARCHAR(50) NOT NULL, - DataId INT NOT NULL, - FitProb REAL, - ResVar REAL, - RegressionType VARCHAR(100), - StdCurve VARCHAR(255), - MinStandardRecovery INT NOT NULL, - MaxStandardRecovery INT NOT NULL, - - CONSTRAINT PK_Luminex_Analyte PRIMARY KEY (RowId), - CONSTRAINT FK_LuminexAnalyte_DataId FOREIGN KEY (DataId) REFERENCES exp.Data(RowId) -); - -CREATE INDEX IX_LuminexAnalyte_DataId ON luminex.Analyte (DataId); - -CREATE UNIQUE INDEX UQ_Analyte_LSID ON luminex.Analyte(LSID); - -ALTER TABLE luminex.Analyte ADD PositivityThreshold INT; - -ALTER TABLE luminex.Analyte ADD NegativeBead VARCHAR(50); -GO - -ALTER TABLE luminex.Analyte ADD BeadNumber NVARCHAR(50); -GO - -CREATE TABLE luminex.DataRow -( - RowId INT IDENTITY(1,1) NOT NULL, - DataId INT NOT NULL, - AnalyteId INT NOT NULL, - Type VARCHAR(10), - Well VARCHAR(50), - Outlier INT, - Description VARCHAR(50), - FIString VARCHAR(20), - FI REAL, - FIOORIndicator VARCHAR(10), - FIBackgroundString VARCHAR(20), - FIBackground REAL, - FIBackgroundOORIndicator VARCHAR(10), - StdDevString VARCHAR(20), - StdDev REAL, - StdDevOORIndicator VARCHAR(10), - ObsConcString VARCHAR(20), - ObsConc REAL, - ObsConcOORIndicator VARCHAR(10), - ExpConc REAL, - ObsOverExp REAL, - ConcInRangeString VARCHAR(20), - ConcInRange REAL, - ConcInRangeOORIndicator VARCHAR(10), - - Dilution REAL, - DataRowGroup VARCHAR(25), - Ratio VARCHAR(25), - SamplingErrors VARCHAR(25), - PTID NVARCHAR(32), - VisitID FLOAT, - Date DATETIME, - ExtraSpecimenInfo NVARCHAR(50), - SpecimenID NVARCHAR(50), - Container EntityID NOT NULL, - ProtocolID INT NOT NULL, - BeadCount INT, - - CONSTRAINT PK_Luminex_DataRow PRIMARY KEY (RowId), - CONSTRAINT FK_LuminexDataRow_DataId FOREIGN KEY (DataId) REFERENCES exp.Data(RowId), - CONSTRAINT FK_LuminexDataRow_AnalyteId FOREIGN KEY (AnalyteId) REFERENCES luminex.analyte(RowId), - CONSTRAINT FK_DataRow_Container FOREIGN KEY (Container) REFERENCES core.Containers (EntityID), - CONSTRAINT FK_DataRow_ProtocolID FOREIGN KEY (ProtocolID) REFERENCES exp.Protocol (RowID) -); -CREATE INDEX IX_LuminexDataRow_DataId ON luminex.DataRow (DataId); -CREATE INDEX IX_LuminexDataRow_AnalyteId ON luminex.DataRow (AnalyteId); -CREATE INDEX IDX_DataRow_Container_ProtocolID ON luminex.datarow(Container, ProtocolID); - -ALTER TABLE luminex.DataRow ALTER COLUMN fistring NVARCHAR(64); -ALTER TABLE luminex.DataRow ALTER COLUMN fibackgroundstring NVARCHAR(64); -ALTER TABLE luminex.DataRow ALTER COLUMN stddevstring NVARCHAR(64); -ALTER TABLE luminex.DataRow ALTER COLUMN obsconcstring NVARCHAR(64); -ALTER TABLE luminex.DataRow ALTER COLUMN concinrangestring NVARCHAR(64); - -ALTER TABLE luminex.datarow ADD LSID LSIDtype; -GO - -ALTER TABLE luminex.datarow ALTER COLUMN LSID LSIDType NOT NULL; - -ALTER TABLE luminex.datarow ADD TitrationId INT; - -GO - -CREATE INDEX IX_LuminexDataRow_TitrationId ON luminex.DataRow (TitrationId); - --- Add the Unknown type for a titration -ALTER TABLE luminex.DataRow ADD WellRole NVARCHAR(50); - -GO - -ALTER TABLE luminex.DataRow ADD Summary BIT; -ALTER TABLE luminex.DataRow ADD CV REAL; - -GO - -ALTER TABLE luminex.DataRow ALTER COLUMN Summary BIT NOT NULL; - -CREATE INDEX IX_LuminexDataRow_LSID ON luminex.DataRow (LSID); - -ALTER TABLE luminex.datarow ADD SinglePointControlId INT; -GO -CREATE INDEX IX_LuminexDataRow_SinglePointControlId ON luminex.DataRow (SinglePointControlId); - -CREATE TABLE luminex.Titration -( - RowId INT IDENTITY(1,1) NOT NULL, - RunId INT NOT NULL, - Name NVARCHAR(255) NOT NULL, - Standard BIT NOT NULL, - QCControl BIT NOT NULL, - - CONSTRAINT PK_Luminex_Titration PRIMARY KEY (RowId), - CONSTRAINT FK_Luminex_Titration_RunId FOREIGN KEY (RunId) REFERENCES exp.ExperimentRun(RowId), - CONSTRAINT UQ_Titration UNIQUE (Name, RunId) -); - -ALTER TABLE luminex.datarow ADD CONSTRAINT FK_Luminex_DataRow_TitrationId FOREIGN KEY (TitrationId) REFERENCES luminex.Titration(RowId); - -CREATE INDEX IX_LuminexTitration_RunId ON luminex.Titration (RunId); - -ALTER TABLE luminex.Titration ADD "unknown" BIT; - -GO - -ALTER TABLE luminex.Titration ALTER COLUMN "unknown" BIT NOT NULL; - -ALTER TABLE luminex.Titration ADD OtherControl BIT; -GO -ALTER TABLE luminex.Titration ALTER COLUMN OtherControl BIT NOT NULL; - -CREATE TABLE luminex.AnalyteTitration -( - AnalyteId INT NOT NULL, - TitrationId INT NOT NULL, - - CONSTRAINT PK_Luminex_AnalyteTitration PRIMARY KEY (AnalyteId, TitrationId) -); - -ALTER TABLE luminex.AnalyteTitration ADD MaxFI REAL; -ALTER TABLE luminex.AnalyteTitration ADD GuideSetId INT; -ALTER TABLE luminex.AnalyteTitration ADD IncludeInGuideSetCalculation BIT NOT NULL; - -GO - -CREATE INDEX IDX_AnalyteTitration_GuideSetId ON luminex.AnalyteTitration(GuideSetId); - --- add missing FK constraint and indices for luminex.AnalyteTitration -ALTER TABLE luminex.AnalyteTitration ADD CONSTRAINT FK_AnalyteTitration_AnalyteId FOREIGN KEY (AnalyteId) REFERENCES luminex.Analyte(RowId); -CREATE INDEX IDX_LuminexAnalyteTitration_AnalyteId ON luminex.AnalyteTitration(AnalyteId); -ALTER TABLE luminex.AnalyteTitration ADD CONSTRAINT FK_AnalyteTitration_TitrationId FOREIGN KEY (TitrationId) REFERENCES luminex.Titration(RowId); -CREATE INDEX IDX_LuminexAnalyteTitration_TitrationId ON luminex.AnalyteTitration(TitrationId); - -CREATE TABLE luminex.WellExclusion -( - RowId INT IDENTITY(1,1) NOT NULL, - Description NVARCHAR(50), - Dilution REAL, - DataId INT NOT NULL, - Comment NVARCHAR(2000), - CreatedBy USERID, - Created DATETIME, - ModifiedBy USERID, - Modified DATETIME, - - CONSTRAINT PK_Luminex_WellExclusion PRIMARY KEY (RowId), - CONSTRAINT FK_LuminexWellExclusion_DataId FOREIGN KEY (DataId) REFERENCES exp.Data(RowId) -); - -ALTER TABLE luminex.WellExclusion ADD Type VARCHAR(10); -GO - -CREATE UNIQUE INDEX UQ_WellExclusion ON luminex.WellExclusion(Description, Dilution, Type, DataId); - -ALTER TABLE luminex.WellExclusion ADD Well NVARCHAR(50); - -CREATE INDEX IDX_LuminexWellExclusion_DataId ON luminex.WellExclusion(DataId); - -CREATE TABLE luminex.WellExclusionAnalyte -( - AnalyteId INT, - WellExclusionId INT NOT NULL, - - CONSTRAINT FK_LuminexWellExclusionAnalyte_AnalyteId FOREIGN KEY (AnalyteId) REFERENCES luminex.Analyte(RowId), - CONSTRAINT FK_LuminexWellExclusionAnalyte_WellExclusionId FOREIGN KEY (WellExclusionId) REFERENCES luminex.WellExclusion(RowId) -); - -ALTER TABLE luminex.WellExclusionAnalyte ALTER COLUMN AnalyteId INT NOT NULL; -ALTER TABLE luminex.WellExclusionAnalyte ADD CONSTRAINT PK_LuminexWellExclusionAnalyte PRIMARY KEY (AnalyteId, WellExclusionId); -CREATE INDEX IDX_LuminexWellExclusionAnalyte_WellExclusionID ON luminex.WellExclusionAnalyte(WellExclusionId); - -CREATE INDEX IDX_LuminexWellExclusionAnalyte_AnalyteId ON luminex.WellExclusionAnalyte(AnalyteId); - -CREATE TABLE luminex.RunExclusion -( - RunId INT NOT NULL, - Comment NVARCHAR(2000), - CreatedBy USERID, - Created DATETIME, - ModifiedBy USERID, - Modified DATETIME, - - CONSTRAINT PK_Luminex_RunExclusion PRIMARY KEY (RunId), - CONSTRAINT FK_LuminexRunExclusion_RunId FOREIGN KEY (RunId) REFERENCES exp.ExperimentRun(RowId) -); - -CREATE INDEX IDX_LuminexRunExclusion_RunId ON luminex.RunExclusion(RunId); - -CREATE TABLE luminex.RunExclusionAnalyte -( - AnalyteId INT NOT NULL, - RunId INT NOT NULL, - - CONSTRAINT FK_LuminexRunExclusionAnalyte_AnalyteId FOREIGN KEY (AnalyteId) REFERENCES luminex.Analyte(RowId), - CONSTRAINT FK_LuminexRunExclusionAnalyte_RunId FOREIGN KEY (RunId) REFERENCES luminex.RunExclusion(RunId) -); - -ALTER TABLE luminex.RunExclusionAnalyte ADD CONSTRAINT PK_LuminexRunExclusionAnalyte PRIMARY KEY (AnalyteId, RunId); -CREATE INDEX IDX_LuminexRunExclusionAnalyte_RunID ON luminex.RunExclusionAnalyte(RunId); - -CREATE INDEX IDX_LuminexRunExclusionAnalyte_AnalyteId ON luminex.RunExclusionAnalyte(AnalyteId); - -CREATE TABLE luminex.CurveFit -( - RowId INT IDENTITY(1,1) NOT NULL, - TitrationId INT NOT NULL, - AnalyteId INT NOT NULL, - CurveType VARCHAR(20) NOT NULL, - EC50 REAL NULL, - AUC REAL NULL, - - CONSTRAINT PK_luminex_CurveFit PRIMARY KEY (rowid), - CONSTRAINT FK_CurveFit_AnalyteIdTitrationId FOREIGN KEY (AnalyteId, TitrationId) REFERENCES luminex.AnalyteTitration (AnalyteId, TitrationId), - CONSTRAINT UQ_CurveFit UNIQUE (AnalyteId, TitrationId, CurveType) -); - -ALTER TABLE luminex.CurveFit ALTER COLUMN CurveType VARCHAR(30); - --- Add the 4 and 5 PL curve fit values -ALTER TABLE luminex.CurveFit ADD MinAsymptote REAL; -ALTER TABLE luminex.CurveFit ADD MaxAsymptote REAL; -ALTER TABLE luminex.CurveFit ADD Asymmetry REAL; -ALTER TABLE luminex.CurveFit ADD Inflection REAL; -ALTER TABLE luminex.CurveFit ADD Slope REAL; - -ALTER TABLE luminex.CurveFit ADD FailureFlag BIT; - --- add missing indices for FK constraints on existing table columns -CREATE INDEX IDX_LuminexCurveFit_AnalyteIdTitrationId ON luminex.CurveFit(AnalyteId, TitrationId); - -CREATE TABLE luminex.GuideSet -( - RowId INT IDENTITY(1,1) NOT NULL, - ProtocolId INT NOT NULL, - AnalyteName VARCHAR(50) NOT NULL, - CurrentGuideSet BIT NOT NULL, - Conjugate VARCHAR(50), - Isotype VARCHAR(50), - - CONSTRAINT PK_luminex_GuideSet PRIMARY KEY (RowId), - CONSTRAINT FK_luminex_GuideSet_ProtocolId FOREIGN KEY (ProtocolId) REFERENCES exp.Protocol(RowId) -); - -ALTER TABLE luminex.AnalyteTitration ADD CONSTRAINT FK_AnalytTitration_GuideSetId FOREIGN KEY (GuideSetId) REFERENCES luminex.GuideSet(RowId); - -CREATE INDEX IDX_GuideSet_ProtocolId ON luminex.GuideSet(ProtocolId); - -ALTER TABLE luminex.GuideSet ADD ControlName VARCHAR(255); -ALTER TABLE luminex.GuideSet ADD Comment TEXT; -ALTER TABLE luminex.GuideSet ADD CreatedBy USERID; -ALTER TABLE luminex.GuideSet ADD Created DATETIME; -ALTER TABLE luminex.GuideSet ADD ModifiedBy USERID; -ALTER TABLE luminex.GuideSet ADD Modified DATETIME; -ALTER TABLE luminex.GuideSet ADD ValueBased BIT; -GO - -ALTER TABLE luminex.GuideSet ALTER COLUMN ValueBased BIT NOT NULL; - -ALTER TABLE luminex.GuideSet ADD EC504PLAverage DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD EC504PLStdDev DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD EC505PLAverage DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD EC505PLStdDev DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD AUCAverage DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD AUCStdDev DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD MaxFIAverage DOUBLE PRECISION; -ALTER TABLE luminex.GuideSet ADD MaxFIStdDev DOUBLE PRECISION; - -ALTER TABLE luminex.GuideSet ADD EC504PLEnabled BIT NOT NULL DEFAULT 1; -ALTER TABLE luminex.GuideSet ADD EC505PLEnabled BIT NOT NULL DEFAULT 1; -ALTER TABLE luminex.GuideSet ADD AUCEnabled BIT NOT NULL DEFAULT 1; -ALTER TABLE luminex.GuideSet ADD MaxFIEnabled BIT NOT NULL DEFAULT 1; - -ALTER TABLE luminex.GuideSet ADD IsTitration BIT; -GO - -ALTER TABLE luminex.GuideSet ALTER COLUMN IsTitration BIT NOT NULL; - -CREATE TABLE luminex.SinglePointControl -( - RowId INT IDENTITY(1,1) NOT NULL, - RunId INT NOT NULL, - Name NVARCHAR(255) NOT NULL, - - CONSTRAINT PK_Luminex_SinglePointControl PRIMARY KEY (RowId), - CONSTRAINT FK_Luminex_SinglePointControl_RunId FOREIGN KEY (RunId) REFERENCES exp.ExperimentRun(RowId), - CONSTRAINT UQ_SinglePointControl UNIQUE (Name, RunId) -); - -CREATE INDEX IX_LuminexSinglePointControl_RunId ON luminex.SinglePointControl(RunId); - -ALTER TABLE luminex.datarow ADD CONSTRAINT FK_Luminex_DataRow_SinglePointControlId FOREIGN KEY (SinglePointControlId) REFERENCES luminex.SinglePointControl(RowId); - -CREATE TABLE luminex.AnalyteSinglePointControl -( - SinglePointControlId INT NOT NULL, - AnalyteId INT NOT NULL, - GuideSetId INT, - IncludeInGuideSetCalculation BIT NOT NULL, - - CONSTRAINT PK_AnalyteSinglePointControl PRIMARY KEY (AnalyteId, SinglePointControlId), - CONSTRAINT FK_AnalyteSinglePointControl_AnalyteId FOREIGN KEY (AnalyteId) REFERENCES luminex.Analyte (RowId), - CONSTRAINT FK_AnalyteSinglePointControl_SinglePointControlId FOREIGN KEY (SinglePointControlId) REFERENCES luminex.SinglePointControl (RowId), - CONSTRAINT FK_AnalyteSinglePointControl_GuideSetId FOREIGN KEY (GuideSetId) REFERENCES luminex.GuideSet (RowId) -); - -CREATE INDEX IDX_AnalyteSinglePointControl_GuideSetId ON luminex.AnalyteSinglePointControl(GuideSetId); -CREATE INDEX IDX_AnalyteSinglePointControl_SinglePointControlId ON luminex.AnalyteSinglePointControl(SinglePointControlId); -CREATE INDEX IDX_AnalyteSinglePointControl_AnalyteId ON luminex.AnalyteSinglePointControl(AnalyteId); diff --git a/luminex/resources/schemas/dbscripts/sqlserver/luminex-25.000-25.001.sql b/luminex/resources/schemas/dbscripts/sqlserver/luminex-25.000-25.001.sql deleted file mode 100644 index 27529a79f..000000000 --- a/luminex/resources/schemas/dbscripts/sqlserver/luminex-25.000-25.001.sql +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ --- This index overlaps with PK_Luminex_RunExclusion -DROP INDEX IDX_LuminexRunExclusion_RunId ON luminex.RunExclusion; --- This index overlaps with PK_LuminexWellExclusionAnalyte -DROP INDEX IDX_LuminexWellExclusionAnalyte_AnalyteId ON luminex.WellExclusionAnalyte; --- This index overlaps with PK_Luminex_AnalyteTitration -DROP INDEX IDX_LuminexAnalyteTitration_AnalyteId ON luminex.AnalyteTitration; --- This index overlaps with PK_AnalyteSinglePointControl -DROP INDEX IDX_AnalyteSinglePointControl_AnalyteId ON luminex.AnalyteSinglePointControl; --- This index overlaps with UQ_CurveFit -DROP INDEX IDX_LuminexCurveFit_AnalyteIdTitrationId ON luminex.CurveFit; --- This index overlaps with PK_LuminexRunExclusionAnalyte -DROP INDEX IDX_LuminexRunExclusionAnalyte_AnalyteId ON luminex.RunExclusionAnalyte; diff --git a/luminex/test/src/org/labkey/test/tests/luminex/LuminexPositivityTest.java b/luminex/test/src/org/labkey/test/tests/luminex/LuminexPositivityTest.java index 50684d35d..2b2e942a3 100644 --- a/luminex/test/src/org/labkey/test/tests/luminex/LuminexPositivityTest.java +++ b/luminex/test/src/org/labkey/test/tests/luminex/LuminexPositivityTest.java @@ -15,7 +15,6 @@ */ package org.labkey.test.tests.luminex; -import org.junit.Assume; import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -23,7 +22,6 @@ import org.labkey.test.BaseWebDriverTest; import org.labkey.test.Locator; import org.labkey.test.TestFileUtils; -import org.labkey.test.WebTestHelper; import org.labkey.test.categories.Assays; import org.labkey.test.categories.Daily; import org.labkey.test.pages.ReactAssayDesignerPage; @@ -80,8 +78,6 @@ public static void updateAssayDesign() @Test (timeout = 16 * 60 * 1000) // Preferable to have the individual test time out rather than the class public void testPositivity() { - Assume.assumeTrue("Skipping test on SQL Server: TODO Issue 28604: Luminex positivity upload occasionally bogs down server", - WebTestHelper.getDatabaseType() != WebTestHelper.DatabaseType.MicrosoftSQLServer); setupResultsDefaultView(); test3xFoldChange(); test5xFoldChange(); diff --git a/luminex/test/src/org/labkey/test/tests/luminex/LuminexTest.java b/luminex/test/src/org/labkey/test/tests/luminex/LuminexTest.java index ca8d29f65..018e51f9c 100644 --- a/luminex/test/src/org/labkey/test/tests/luminex/LuminexTest.java +++ b/luminex/test/src/org/labkey/test/tests/luminex/LuminexTest.java @@ -72,9 +72,7 @@ public abstract class LuminexTest extends BaseWebDriverTest protected final static String TEST_ASSAY_SUBFOLDER = "Subfolder";//project for luminex test - // Issue 51845: - // - Luminex assay not working well when assay name contains dot (.) - // - use DOMAIN_SPECIAL_STRING instead of DOMAIN_TRICKY_CHARACTERS since sql server is not working with unicode characters + // Issue 51845: Luminex assay not working well when assay name contains dot (.) public static final String TEST_ASSAY_LUM = "TestAssayLuminex" + DOMAIN_SPECIAL_STRING.replaceAll("\\.", ""); protected static final String TEST_ASSAY_LUM_DESC = "Description for Luminex assay"; diff --git a/ms2/module.properties b/ms2/module.properties index 2f5aeba35..99da70bba 100644 --- a/ms2/module.properties +++ b/ms2/module.properties @@ -10,5 +10,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/ms2/resources/schemas/dbscripts/sqlserver/ms2-0.000-21.000.sql b/ms2/resources/schemas/dbscripts/sqlserver/ms2-0.000-21.000.sql deleted file mode 100644 index 35a068c70..000000000 --- a/ms2/resources/schemas/dbscripts/sqlserver/ms2-0.000-21.000.sql +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (c) 2019-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -CREATE SCHEMA ms2; -GO - -CREATE TABLE ms2.Runs -( - -- standard fields - _ts TIMESTAMP, - Run INT IDENTITY(1, 1), - CreatedBy USERID, - Created DATETIME, - ModifiedBy USERID, - Modified DATETIME, - Owner USERID NULL, - - Container ENTITYID NOT NULL, - EntityId ENTITYID DEFAULT NEWID(), - Description NVARCHAR(300), - Path NVARCHAR(500), - FileName NVARCHAR(300), - Status NVARCHAR(200), - StatusId INT NOT NULL DEFAULT 0, - Type NVARCHAR(30), - SearchEngine NVARCHAR(20), - MassSpecType NVARCHAR(200), - SearchEnzyme NVARCHAR(50), - Deleted BIT NOT NULL DEFAULT 0, - ExperimentRunLSID LSIDType NULL, - HasPeptideProphet BIT NOT NULL DEFAULT '0', - PeptideCount INT NOT NULL DEFAULT 0, - SpectrumCount INT NOT NULL DEFAULT 0, - NegativeHitCount INT NOT NULL DEFAULT 0, -- Store reverse peptide counts to enable scoring analysis UI. - - CONSTRAINT PK_MS2Runs PRIMARY KEY (Run) -); - --- Create indexes on ms2 Runs table to support common operations in MS2Manager -CREATE INDEX MS2Runs_Stats ON ms2.Runs (PeptideCount, SpectrumCount, Deleted, StatusId); -CREATE INDEX MS2Runs_ExperimentRunLSID ON ms2.Runs(ExperimentRunLSID); -CREATE INDEX MS2Runs_Container ON ms2.Runs(Container); - -UPDATE ms2.Runs SET Type = 'LegacyComet' WHERE Type = 'Comet'; - -ALTER TABLE ms2.Runs ADD MascotFile NVARCHAR(300) NULL; -ALTER TABLE ms2.Runs ADD DistillerRawFile NVARCHAR(500) NULL; - --- Issue 27667 - Importing failed due to data type length limitation -ALTER TABLE ms2.Runs ALTER COLUMN mascotfile NVARCHAR(MAX); - -CREATE TABLE ms2.Fractions -( - Fraction INT IDENTITY(1,1), - Run INT NOT NULL, - Description NVARCHAR(300), - FileName NVARCHAR(300), - HydroB0 REAL, - HydroB1 REAL, - HydroR2 REAL, - HydroSigma REAL, - PepXmlDataLSID LSIDType NULL, - MzXmlURL VARCHAR(400) NULL, - - CONSTRAINT PK_MS2Fractions PRIMARY KEY (Fraction) -); - -CREATE INDEX IX_Fractions_Run_Fraction ON ms2.Fractions(Run, Fraction); -CREATE INDEX IX_Fractions_MzXMLURL ON ms2.fractions(mzxmlurl); - -ALTER TABLE ms2.Fractions ADD ScanCount INT -ALTER TABLE ms2.Fractions ADD MS1ScanCount INT -ALTER TABLE ms2.Fractions ADD MS2ScanCount INT -ALTER TABLE ms2.Fractions ADD MS3ScanCount INT -ALTER TABLE ms2.Fractions ADD MS4ScanCount INT - - -CREATE TABLE ms2.Modifications -( - Run INT NOT NULL, - AminoAcid VARCHAR (1) NOT NULL, - MassDiff REAL NOT NULL, - Variable BIT NOT NULL, - Symbol VARCHAR (1) NOT NULL, - - CONSTRAINT PK_MS2Modifications PRIMARY KEY (Run, AminoAcid, Symbol) -); - --- Store MS2 Spectrum data in separate table to improve performance of upload and MS2Peptides queries -CREATE TABLE ms2.SpectraData -( - Fraction INT NOT NULL, - Scan INT NOT NULL, - Spectrum IMAGE NOT NULL, - - CONSTRAINT PK_MS2SpectraData PRIMARY KEY (Fraction, Scan) -); - -CREATE TABLE ms2.PeptidesData -( - RowId BIGINT IDENTITY (1, 1) NOT NULL, - Fraction INT NOT NULL, - Scan INT NOT NULL, - Charge TINYINT NOT NULL, - Score1 REAL NULL, - Score2 REAL NULL, - Score3 REAL NULL, - Score4 REAL NULL, - Score5 REAL NULL, - IonPercent REAL NOT NULL, - Mass FLOAT NOT NULL, -- Store mass as high-precision real - DeltaMass REAL NOT NULL, - PeptideProphet REAL NOT NULL, - Peptide VARCHAR (200) NOT NULL, - PrevAA CHAR(1) NOT NULL DEFAULT '', - TrimmedPeptide VARCHAR(200) NOT NULL DEFAULT '', - NextAA CHAR(1) NOT NULL DEFAULT '', - ProteinHits SMALLINT NOT NULL, - SequencePosition INT NOT NULL DEFAULT 0, - Protein VARCHAR (100) NOT NULL, - SeqId INT NULL, - RetentionTime REAL NULL, - PeptideProphetErrorRate REAL NULL, - EndScan INT NULL, - - CONSTRAINT PK_MS2PeptidesData PRIMARY KEY NONCLUSTERED (RowId) -); - -CREATE INDEX IX_MS2PeptidesData_Protein ON ms2.PeptidesData(Protein); - --- this is not a declared fk -CREATE INDEX IX_PeptidesData_SeqId ON ms2.PeptidesData(SeqId); - -CREATE INDEX IX_MS2PeptidesData_TrimmedPeptide ON ms2.PeptidesData(TrimmedPeptide); -CREATE INDEX IX_MS2PeptidesData_Peptide ON ms2.PeptidesData(Peptide); - -ALTER TABLE ms2.PeptidesData ADD score6 REAL; -ALTER TABLE ms2.PeptidesData ADD QueryNumber int NULL; -ALTER TABLE ms2.PeptidesData ADD HitRank int NOT NULL DEFAULT 1; -ALTER TABLE ms2.PeptidesData ADD Decoy bit NOT NULL DEFAULT 0; - -ALTER TABLE ms2.PeptidesData ALTER COLUMN PeptideProphet REAL NULL; - -ALTER TABLE ms2.peptidesdata - ADD CONSTRAINT FK_ms2PeptidesData_ProtSequences FOREIGN KEY (seqid) REFERENCES prot.sequences (seqid); - -CREATE UNIQUE CLUSTERED INDEX UQ_MS2PeptidesData_FractionScanCharge ON ms2.PeptidesData(Fraction, Scan, EndScan, Charge, HitRank, Decoy, QueryNumber); - -CREATE TABLE ms2.PeptideProphetSummaries -( - Run INT NOT NULL, - FValSeries IMAGE NULL, - ObsSeries1 IMAGE NULL, - ObsSeries2 IMAGE NULL, - ObsSeries3 IMAGE NULL, - ModelPosSeries1 IMAGE NULL, - ModelPosSeries2 IMAGE NULL, - ModelPosSeries3 IMAGE NULL, - ModelNegSeries1 IMAGE NULL, - ModelNegSeries2 IMAGE NULL, - ModelNegSeries3 IMAGE NULL, - MinProbSeries IMAGE NULL, - SensitivitySeries IMAGE NULL, - ErrorSeries IMAGE NULL, - - CONSTRAINT PK_PeptideProphetSummmaries PRIMARY KEY (Run) -); - -CREATE TABLE ms2.ProteinProphetFiles -( - RowId INT IDENTITY (1, 1) NOT NULL, - FilePath VARCHAR(255) NOT NULL, - Run INT NOT NULL, - UploadCompleted BIT DEFAULT 0 NOT NULL, - MinProbSeries IMAGE NULL, - SensitivitySeries IMAGE NULL, - ErrorSeries IMAGE NULL, - PredictedNumberCorrectSeries IMAGE NULL, - PredictedNumberIncorrectSeries IMAGE NULL, - - CONSTRAINT PK_MS2ProteinProphetFiles PRIMARY KEY (RowId), - CONSTRAINT FK_MS2ProteinProphetFiles_MS2Runs FOREIGN KEY (Run) REFERENCES ms2.Runs(Run), - CONSTRAINT UQ_MS2ProteinProphetFiles UNIQUE (Run) -); - -ALTER TABLE ms2.proteinprophetfiles ALTER COLUMN FilePath NVARCHAR(512); - -CREATE TABLE ms2.ProteinGroups -( - RowId INT IDENTITY (1, 1) NOT NULL, - GroupProbability REAL NOT NULL, - ProteinProphetFileId INT NOT NULL, - GroupNumber INT NOT NULL, - IndistinguishableCollectionId INT NOT NULL, - UniquePeptidesCount INT NOT NULL, - TotalNumberPeptides INT NOT NULL, - PctSpectrumIds REAL NULL, - PercentCoverage REAL NULL, - ProteinProbability REAL NOT NULL DEFAULT 0, - ErrorRate REAL NULL, - - CONSTRAINT PK_MS2ProteinGroups PRIMARY KEY (RowId), - CONSTRAINT UQ_MS2ProteinGroups UNIQUE NONCLUSTERED (ProteinProphetFileId, GroupNumber, IndistinguishableCollectionId), - CONSTRAINT FK_MS2ProteinGroup_MS2ProteinProphetFileId FOREIGN KEY (ProteinProphetFileId) REFERENCES ms2.ProteinProphetFiles(RowId) -); - -CREATE TABLE ms2.ProteinGroupMemberships -( - ProteinGroupId INT NOT NULL, - SeqId INT NOT NULL, - Probability REAL NOT NULL, - - CONSTRAINT PK_MS2ProteinGroupMemberships PRIMARY KEY (ProteinGroupId, SeqId), - CONSTRAINT FK_MS2ProteinGroupMemberships_ProtSequences FOREIGN KEY (SeqId) REFERENCES prot.Sequences (SeqId), - CONSTRAINT FK_MS2ProteinGroupMembership_MS2ProteinGroups FOREIGN KEY (ProteinGroupId) REFERENCES ms2.ProteinGroups (RowId) -); - -CREATE INDEX IX_ProteinGroupMemberships_SeqId ON ms2.ProteinGroupMemberships(SeqId, ProteinGroupId, Probability); - -CREATE TABLE ms2.PeptideMemberships -( - PeptideId BIGINT NOT NULL, - ProteinGroupId INT NOT NULL, - NSPAdjustedProbability REAL NOT NULL, - Weight REAL NOT NULL, - NondegenerateEvidence BIT NOT NULL, - EnzymaticTermini INT NOT NULL, - SiblingPeptides REAL NOT NULL, - SiblingPeptidesBin INT NOT NULL, - Instances INT NOT NULL, - ContributingEvidence BIT NOT NULL, - CalcNeutralPepMass REAL NOT NULL, - - CONSTRAINT pk_ms2peptidememberships PRIMARY KEY (proteingroupid, peptideid), - CONSTRAINT fk_ms2peptidemembership_ms2peptidesdata FOREIGN KEY (peptideid) REFERENCES ms2.PeptidesData (rowid), - CONSTRAINT fk_ms2peptidemembership_ms2proteingroup FOREIGN KEY (proteingroupid) REFERENCES ms2.ProteinGroups (rowid) -); - --- Index to speed up deletes from MS2PeptidesData. -CREATE INDEX IX_MS2PeptideMemberships_PeptideId ON ms2.PeptideMemberships(PeptideId); -CREATE INDEX IX_Peptidemembership_ProteingroupId ON ms2.PeptideMemberships(ProteinGroupId) - -CREATE TABLE ms2.Quantitation -( - PeptideId BIGINT NOT NULL, - LightFirstscan INT NOT NULL, - LightLastscan INT NOT NULL, - LightMass REAL NOT NULL, - HeavyFirstscan INT NOT NULL, - HeavyLastscan INT NOT NULL, - HeavyMass REAL NOT NULL, - Ratio VARCHAR(20) NULL, -- q3 does not generate string representations of ratios - Heavy2lightRatio VARCHAR(20) NULL, -- q3 does not generate string representations of ratios - LightArea REAL NOT NULL, - HeavyArea REAL NOT NULL, - DecimalRatio REAL NOT NULL, - QuantId INT NOT NULL, -- QuantId must be non-null; eventually (PeptideId, QuantId) should become a compound PK - - CONSTRAINT PK_Quantitation PRIMARY KEY (PeptideId), - CONSTRAINT FK_Quantitation_MS2PeptidesData FOREIGN KEY (PeptideId) REFERENCES ms2.PeptidesData(RowId) -); - -ALTER TABLE ms2.Quantitation ADD Invalidated BIT; -GO - -CREATE TABLE ms2.ProteinQuantitation -( - ProteinGroupId INT NOT NULL, - RatioMean REAL NOT NULL, - RatioStandardDev REAL NOT NULL, - RatioNumberPeptides INT NOT NULL, - Heavy2LightRatioMean REAL NOT NULL, - Heavy2LightRatioStandardDev REAL NOT NULL, - - CONSTRAINT PK_ProteinQuantitation PRIMARY KEY (ProteinGroupId), - CONSTRAINT FK_ProteinQuantitation_ProteinGroup FOREIGN KEY (ProteinGroupId) REFERENCES ms2.ProteinGroups (RowId) -); - -CREATE INDEX IX_ProteinQuantitation_ProteinGroupId ON ms2.ProteinQuantitation(ProteinGroupId); - --- Add a quantitation summary table -CREATE TABLE ms2.QuantSummaries -( - QuantId INT IDENTITY(1,1) NOT NULL, - Run INT NOT NULL, - AnalysisType NVARCHAR(20) NOT NULL, - AnalysisTime DATETIME NULL, - Version NVARCHAR(80) NULL, - LabeledResidues NVARCHAR(20) NULL, - MassDiff NVARCHAR(80) NULL, - MassTol REAL NOT NULL, - SameScanRange CHAR(1) NULL, - XpressLight INT NULL, - - CONSTRAINT PK_QuantSummaries PRIMARY KEY (QuantId), - CONSTRAINT FK_QuantSummaries_MS2Runs FOREIGN KEY (Run) REFERENCES ms2.Runs (Run), - -- Current restrictions allow only one quantitation analysis per run - CONSTRAINT UQ_QuantSummaries UNIQUE (Run) -); - -CREATE TABLE ms2.PeptideProphetData -( - PeptideId BIGINT NOT NULL, - ProphetFVal REAL NOT NULL, - ProphetDeltaMass REAL NULL, - ProphetNumTrypticTerm INT NULL, - ProphetNumMissedCleav INT NULL, - - CONSTRAINT PK_PeptideProphetData PRIMARY KEY (PeptideId), - CONSTRAINT FK_PeptideProphetData_MS2PeptidesData FOREIGN KEY (PeptideId) REFERENCES ms2.PeptidesData(RowId) -); - -UPDATE exp.DataInput SET Role = 'Spectra' WHERE Role = 'mzXML'; - -GO - -CREATE TABLE ms2.iTraqPeptideQuantitation -( - PeptideId BIGINT NOT NULL, - TargetMass1 REAL, - AbsoluteMass1 REAL, - Normalized1 REAL, - TargetMass2 REAL, - AbsoluteMass2 REAL, - Normalized2 REAL, - TargetMass3 REAL, - AbsoluteMass3 REAL, - Normalized3 REAL, - TargetMass4 REAL, - AbsoluteMass4 REAL, - Normalized4 REAL, - TargetMass5 REAL, - AbsoluteMass5 REAL, - Normalized5 REAL, - TargetMass6 REAL, - AbsoluteMass6 REAL, - Normalized6 REAL, - TargetMass7 REAL, - AbsoluteMass7 REAL, - Normalized7 REAL, - TargetMass8 REAL, - AbsoluteMass8 REAL, - Normalized8 REAL, - - CONSTRAINT PK_iTraqPeptideQuantitation PRIMARY KEY (PeptideId), - CONSTRAINT FK_iTraqPeptideQuantitation_MS2PeptidesData FOREIGN KEY (PeptideId) REFERENCES ms2.PeptidesData(RowId) -) -GO - -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass1', 'AbsoluteIntensity1', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass2', 'AbsoluteIntensity2', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass3', 'AbsoluteIntensity3', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass4', 'AbsoluteIntensity4', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass5', 'AbsoluteIntensity5', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass6', 'AbsoluteIntensity6', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass7', 'AbsoluteIntensity7', 'COLUMN' -EXEC sp_rename 'ms2.iTraqPeptideQuantitation.AbsoluteMass8', 'AbsoluteIntensity8', 'COLUMN' -GO - -ALTER TABLE ms2.itraqpeptidequantitation ADD TargetMass9 REAL; -ALTER TABLE ms2.itraqpeptidequantitation ADD AbsoluteIntensity9 REAL; -ALTER TABLE ms2.itraqpeptidequantitation ADD Normalized9 REAL; -ALTER TABLE ms2.itraqpeptidequantitation ADD TargetMass10 REAL; -ALTER TABLE ms2.itraqpeptidequantitation ADD AbsoluteIntensity10 REAL; -ALTER TABLE ms2.itraqpeptidequantitation ADD Normalized10 REAL; - -CREATE TABLE ms2.iTraqProteinQuantitation -( - ProteinGroupId INT NOT NULL, - Ratio1 REAL, - Error1 REAL, - Ratio2 REAL, - Error2 REAL, - Ratio3 REAL, - Error3 REAL, - Ratio4 REAL, - Error4 REAL, - Ratio5 REAL, - Error5 REAL, - Ratio6 REAL, - Error6 REAL, - Ratio7 REAL, - Error7 REAL, - Ratio8 REAL, - Error8 REAL, - - CONSTRAINT PK_iTraqProteinQuantitation PRIMARY KEY (ProteinGroupId), - CONSTRAINT FK_iTraqProteinQuantitation_ProteinGroups FOREIGN KEY (ProteinGroupId) REFERENCES ms2.ProteinGroups(RowId) -) -GO - -ALTER TABLE ms2.itraqproteinquantitation ADD Ratio9 REAL; -ALTER TABLE ms2.itraqproteinquantitation ADD Error9 REAL; -ALTER TABLE ms2.itraqproteinquantitation ADD Ratio10 REAL; -ALTER TABLE ms2.itraqproteinquantitation ADD Error10 REAL; - -CREATE TABLE ms2.ExpressionData ( - RowId INT IDENTITY (1,1) NOT NULL, - Value REAL, - SeqId INT NOT NULL, - SampleId INT NOT NULL, - DataId INT NOT NULL, - - CONSTRAINT PK_ExpressionData PRIMARY KEY (RowId), - CONSTRAINT FK_ExpressionData_SeqId FOREIGN KEY (SeqId) REFERENCES prot.sequences (SeqId), - CONSTRAINT FK_ExpressionData_SampleId FOREIGN KEY (SampleId) REFERENCES exp.material (RowId), - CONSTRAINT FK_ExpressionData_DataId FOREIGN KEY (DataId) REFERENCES exp.data (RowId) -); - -CREATE INDEX IX_ExpressionData_SeqId ON ms2.ExpressionData(SeqId); -CREATE INDEX IX_ExpressionData_SampleId ON ms2.ExpressionData(SampleId); - -ALTER TABLE ms2.ExpressionData ADD CONSTRAINT UQ_ExpressionData_DataId_SeqId_SampleId UNIQUE (DataId, SeqId, SampleId); - -CREATE TABLE ms2.FastaRunMapping ( - Run INT NOT NULL, - FastaId INT NOT NULL, - - CONSTRAINT PK_FastaRunMapping PRIMARY KEY (Run, FastaId), - CONSTRAINT FK_FastaRunMapping_Run FOREIGN KEY (Run) REFERENCES ms2.Runs (Run), - CONSTRAINT FK_FastaRunMapping_FastaId FOREIGN KEY (FastaId) REFERENCES prot.FastaFiles (FastaId) -); - -CREATE INDEX IX_FastaRunMapping_FastaId ON ms2.FastaRunMapping(FastaId); diff --git a/ms2/resources/schemas/dbscripts/sqlserver/ms2-25.000-25.001.sql b/ms2/resources/schemas/dbscripts/sqlserver/ms2-25.000-25.001.sql deleted file mode 100644 index e9b573a84..000000000 --- a/ms2/resources/schemas/dbscripts/sqlserver/ms2-25.000-25.001.sql +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ --- This index overlaps with PK_ProteinQuantitation -DROP INDEX IX_ProteinQuantitation_ProteinGroupId ON ms2.ProteinQuantitation; --- This index overlaps with pk_ms2peptidememberships -DROP INDEX IX_Peptidemembership_ProteingroupId ON ms2.PeptideMemberships; diff --git a/ms2/resources/schemas/dbscripts/sqlserver/ms2-create.sql b/ms2/resources/schemas/dbscripts/sqlserver/ms2-create.sql deleted file mode 100644 index f6a6ceee5..000000000 --- a/ms2/resources/schemas/dbscripts/sqlserver/ms2-create.sql +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -CREATE VIEW ms2.Spectra AS - SELECT f.Run AS Run, sd.* - FROM ms2.SpectraData sd INNER JOIN - ms2.Fractions f ON sd.Fraction = f.Fraction -GO - -CREATE VIEW ms2.FastaAdmin AS - SELECT ff.FileName, ff.FastaId, ff.Loaded, runs.Runs - FROM prot.FastaFiles ff LEFT OUTER JOIN - (SELECT FastaId, COUNT(Run) AS Runs - FROM ms2.FastaRunMapping - GROUP BY FastaId) runs ON runs.FastaId = ff.FastaId -GO - -CREATE VIEW ms2.ExperimentRuns AS - SELECT ms2.Runs.*, exp.ExperimentRun.RowId AS ExperimentRunRowId, exp.Protocol.Name AS ProtocolName - FROM ms2.Runs - LEFT OUTER JOIN exp.ExperimentRun ON exp.ExperimentRun.LSID=ms2.Runs.ExperimentRunLSID - LEFT OUTER JOIN exp.Protocol ON exp.Protocol.LSID=exp.ExperimentRun.ProtocolLSID -GO - -CREATE VIEW ms2.ProteinGroupsWithQuantitation AS - SELECT * FROM ms2.ProteinGroups LEFT JOIN ms2.ProteinQuantitation ON ProteinGroupId = RowId -GO - --- Union of all MS2Peptides columns; alias Score1 to RawScore and SpScore, Score2 to DiffScore and DeltaCn, etc. -CREATE VIEW ms2.SimplePeptides AS SELECT - frac.Run, run.Description AS RunDescription, pep.Fraction, CASE WHEN CHARINDEX('.', frac.FileName) >= 1 THEN LEFT(frac.FileName, CHARINDEX('.', frac.FileName) - 1) ELSE frac.FileName END AS FractionName, Scan, EndScan, - RetentionTime, Charge, Score1 AS RawScore, Score2 AS DiffScore, Score3 AS ZScore, Score1 AS SpScore, Score2 AS DeltaCn, Score3 AS XCorr, Score4 AS SpRank, Score1 AS OrigScore, - Score1 AS Hyper, Score2 AS Next, Score3 AS B, Score4 AS Y, Score5 AS Expect, Score1 AS Ion, Score2 AS "Identity", Score3 AS Homology, - IonPercent, pep.Mass, DeltaMass, (pep.Mass + DeltaMass) AS PrecursorMass, ABS(DeltaMass - ROUND(DeltaMass, 0)) AS FractionalDeltaMass, - CASE WHEN pep.Mass = 0 THEN 0 ELSE ABS(1000000 * ABS(DeltaMass - ROUND(DeltaMass, 0)) / (pep.Mass + (Charge - 1) * 1.007276)) END AS FractionalDeltaMassPPM, - CASE WHEN pep.Mass = 0 THEN 0 ELSE ABS(1000000 * DeltaMass / (pep.Mass + (Charge - 1) * 1.007276)) END AS DeltaMassPPM, - CASE WHEN Charge = 0 THEN 0 ELSE (pep.Mass + DeltaMass + (Charge - 1) * 1.007276) / Charge END AS MZ, PeptideProphet, PeptideProphetErrorRate, Peptide, ProteinHits, - Protein, PrevAA, TrimmedPeptide, NextAA, LTRIM(RTRIM(PrevAA + TrimmedPeptide + NextAA)) AS StrippedPeptide, SequencePosition, pep.SeqId, pep.RowId, - quant.DecimalRatio, quant.Heavy2LightRatio, quant.HeavyArea, quant.HeavyFirstScan, quant.HeavyLastScan, quant.HeavyMass, quant.LightArea, quant.LightFirstScan, quant.LightLastScan, quant.LightMass, quant.Ratio, quant.Invalidated, - proph.ProphetFVal, proph.ProphetDeltaMass, proph.ProphetNumTrypticTerm, proph.ProphetNumMissedCleav, pep.QueryNumber, pep.HitRank, pep.Decoy - FROM ms2.PeptidesData pep - INNER JOIN - ms2.Fractions frac ON pep.Fraction = frac.Fraction - INNER JOIN - ms2.Runs run ON frac.Run = run.Run - LEFT JOIN ms2.quantitation quant ON pep.rowid=quant.peptideid - LEFT JOIN ms2.peptideprophetdata proph ON pep.rowid=proph.peptideid -GO - -CREATE VIEW ms2.Peptides AS - SELECT pep.*, seq.description, seq.bestgenename AS genename - FROM ms2.SimplePeptides pep - LEFT JOIN prot.sequences seq ON seq.seqid = pep.seqid -GO \ No newline at end of file diff --git a/ms2/resources/schemas/dbscripts/sqlserver/ms2-drop.sql b/ms2/resources/schemas/dbscripts/sqlserver/ms2-drop.sql deleted file mode 100644 index fe3fc784e..000000000 --- a/ms2/resources/schemas/dbscripts/sqlserver/ms2-drop.sql +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2007-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -EXEC core.fn_dropifexists 'Peptides', 'ms2', 'VIEW', NULL -EXEC core.fn_dropifexists 'SimplePeptides', 'ms2', 'VIEW', NULL -EXEC core.fn_dropifexists 'ProteinGroupsWithQuantitation', 'ms2', 'VIEW', NULL -EXEC core.fn_dropifexists 'ExperimentRuns', 'ms2', 'VIEW', NULL -EXEC core.fn_dropifexists 'FastaAdmin', 'ms2', 'VIEW', NULL -EXEC core.fn_dropifexists 'Spectra', 'ms2', 'VIEW', NULL -GO diff --git a/ms2/src/org/labkey/ms2/PeptideManager.java b/ms2/src/org/labkey/ms2/PeptideManager.java index 1b19ad44a..1b095ea04 100644 --- a/ms2/src/org/labkey/ms2/PeptideManager.java +++ b/ms2/src/org/labkey/ms2/PeptideManager.java @@ -225,7 +225,6 @@ public static List getProteinsContainingPeptide(MS2Peptide peptide, int } sql.add("%" + peptide.getTrimmedPeptide() + "%"); - //based on observations of 2 larger ms2 databases, TOP 20 causes better query plan generation in SQL Server sql = ProteinSchema.getSchema().getSqlDialect().limitRows(sql, Math.max(20, hits)); } diff --git a/ms2/src/org/labkey/ms2/compare/CompareQuery.java b/ms2/src/org/labkey/ms2/compare/CompareQuery.java index 77f55ec7d..0b35239d0 100644 --- a/ms2/src/org/labkey/ms2/compare/CompareQuery.java +++ b/ms2/src/org/labkey/ms2/compare/CompareQuery.java @@ -366,9 +366,6 @@ protected void sort() Sort sort = new Sort("-RunCount,-Pattern," + getLabelColumn()); sort.addURLSort(_currentUrl, MS2Manager.getDataRegionNameCompare()); - // TODO: If there are more than three columns in the sort list, then it may be that "BestName" and "Protein" - // are in the list, in which case SQL server will fail to execute the query. Therefore, we restrict the number - // of columns you can sort on to 3. while (sort.getSortList().size() > 3) { sort.deleteSortColumn(sort.getSortList().size() - 1); diff --git a/ms2/src/org/labkey/ms2/protein/tools/PieJChartHelper.java b/ms2/src/org/labkey/ms2/protein/tools/PieJChartHelper.java index 8e2ff7da2..34cbb2de3 100644 --- a/ms2/src/org/labkey/ms2/protein/tools/PieJChartHelper.java +++ b/ms2/src/org/labkey/ms2/protein/tools/PieJChartHelper.java @@ -149,9 +149,7 @@ public static PieJChartHelper prepareGOPie(String title, SQLFragment distinctSeq int seqId = rs.getInt(1); int locId = rs.getInt(2); - // We are simulating SELECT MIN(ThirdLevelId) ... GROUP BY SeqId, LocId in Java because SQL Server 2000 - // explodes if we add one more GROUP BY clause to this query, see issue #1664 - // + // Simulates SELECT MIN(ThirdLevelId) ... GROUP BY SeqId, LocId in Java // TODO: we should consider removing this and creating the chart with all matching ThirdLevelIds instead if (seqId == prevSeqId && locId == prevLocId) continue; diff --git a/ms2/src/org/labkey/ms2/query/MS2Schema.java b/ms2/src/org/labkey/ms2/query/MS2Schema.java index acb7a1707..5db0b3af2 100644 --- a/ms2/src/org/labkey/ms2/query/MS2Schema.java +++ b/ms2/src/org/labkey/ms2/query/MS2Schema.java @@ -56,7 +56,6 @@ import org.labkey.api.exp.query.ExpRunTable; import org.labkey.api.exp.query.ExpSchema; import org.labkey.api.module.Module; -import org.labkey.api.protein.ProteinSchema; import org.labkey.api.protein.ProteomicsModule; import org.labkey.api.protein.query.SequencesTableInfo; import org.labkey.api.query.CustomView; @@ -1533,23 +1532,7 @@ private ForeignKey createSequencesLookup() @Override public TableInfo getLookupTableInfo() { - SequencesTableInfo result = createSequencesTable(getLookupContainerFilter()); - // This is a horrible hack to try to deal with https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=5237 - // Performance on a SQLServer installation with a large number of runs and sequences is much better with - // this condition because it causes the query plan to flip to something that does a much more efficient - // join with the sequences tables. However, adding it significantly degrades performance on my admittedly - // small (though not tiny) Postgres dev database - if (_runs != null && MS2Manager.getSchema().getSqlDialect().isSqlServer()) - { - SQLFragment sql = new SQLFragment(); - sql.append("(SeqId IN (SELECT SeqId FROM " + ProteinSchema.getTableInfoFastaSequences() + " WHERE FastaId IN (SELECT FastaId FROM "); - sql.append(MS2Manager.getTableInfoFastaRunMapping() + " WHERE Run IN "); - appendRunInClause(sql); - sql.append(")))"); - - result.addCondition(sql, FieldKey.fromParts("SeqId")); - } - return result; + return createSequencesTable(getLookupContainerFilter()); } }; } diff --git a/ms2/src/org/labkey/ms2/query/SpectraCountTableInfo.java b/ms2/src/org/labkey/ms2/query/SpectraCountTableInfo.java index 6c36ae9cd..16c8cba8b 100644 --- a/ms2/src/org/labkey/ms2/query/SpectraCountTableInfo.java +++ b/ms2/src/org/labkey/ms2/query/SpectraCountTableInfo.java @@ -246,8 +246,7 @@ public SQLFragment getFromSQL() sql.append(", MIN(pd.trimmedpeptide) as TrimmedPeptide\n"); } - // SQLServer can't GROUP BY a TEXT field, so convert to VARCHAR - String protSequenceSQL = getSqlDialect().isSqlServer() ? "CAST(s.ProtSequence AS VARCHAR(MAX))" : "s.ProtSequence"; + String protSequenceSQL = "s.ProtSequence"; if (_config.isGroupedByCharge()) { diff --git a/nab/module.properties b/nab/module.properties index afb2b89b7..f27311fa0 100644 --- a/nab/module.properties +++ b/nab/module.properties @@ -7,5 +7,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/nab/resources/schemas/dbscripts/sqlserver/nab-0.000-22.000.sql b/nab/resources/schemas/dbscripts/sqlserver/nab-0.000-22.000.sql deleted file mode 100644 index 4552805d9..000000000 --- a/nab/resources/schemas/dbscripts/sqlserver/nab-0.000-22.000.sql +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2019-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* nab-12.30-13.10.sql */ - -CREATE SCHEMA nab; -GO - -CREATE TABLE nab.CutoffValue -( - RowId INT IDENTITY (1, 1) NOT NULL, - NAbSpecimenId INT NOT NULL, - Cutoff DOUBLE PRECISION, - Point DOUBLE PRECISION, - PointOORIndicator NVARCHAR(20), - - IC_Poly DOUBLE PRECISION, - IC_PolyOORIndicator NVARCHAR(20), - IC_4pl DOUBLE PRECISION, - IC_4plOORIndicator NVARCHAR(20), - IC_5pl DOUBLE PRECISION, - IC_5plOORIndicator NVARCHAR(20), - - CONSTRAINT PK_NAb_CutoffValue PRIMARY KEY (RowId) -); - -CREATE TABLE nab.NAbSpecimen -( - RowId INT IDENTITY (1, 1) NOT NULL, - DataId INT, - RunId INT NOT NULL, - SpecimenLSID LSIDtype NOT NULL, - FitError DOUBLE PRECISION, - WellgroupName NVARCHAR(100), - - AUC_poly DOUBLE PRECISION, - PositiveAUC_Poly DOUBLE PRECISION, - AUC_4pl DOUBLE PRECISION, - PositiveAUC_4pl DOUBLE PRECISION, - AUC_5pl DOUBLE PRECISION, - PositiveAUC_5pl DOUBLE PRECISION, - - -- For legacy migration purposes - ObjectUri NVARCHAR(300), - ObjectId INT NOT NULL, - ProtocolId INT, - viruslsid lsidtype, - - CONSTRAINT PK_NAb_Specimen PRIMARY KEY (RowId), - CONSTRAINT FK_NAbSpecimen_ExperimentRun FOREIGN KEY (RunId) - REFERENCES Exp.ExperimentRun (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT FK_NAbSpecimen_SpecimenLSID FOREIGN KEY (SpecimenLSID) - REFERENCES Exp.Material (LSID) - ON UPDATE NO ACTION ON DELETE NO ACTION -); - -CREATE INDEX IDX_NAbSpecimen_RunId ON nab.NAbSpecimen(RunId); -CREATE INDEX IDX_NAbSpecimen_ObjectId ON nab.NAbSpecimen(ObjectId); -CREATE INDEX IDX_NAbSpecimen_DataId ON nab.NAbSpecimen(DataId); - -ALTER TABLE nab.CutoffValue ADD CONSTRAINT FK_CutoffValue_NAbSpecimen FOREIGN KEY (NAbSpecimenId) - REFERENCES nab.NAbSpecimen (rowid); -ALTER TABLE nab.NAbSpecimen ADD CONSTRAINT FK_NAbSpecimen_ProtocolId FOREIGN KEY (ProtocolId) - REFERENCES Exp.Protocol (rowid); - - -CREATE INDEX IDX_NAbSpecimen_ProtocolId ON nab.NAbSpecimen(ProtocolId); -CREATE INDEX IDX_CutoffValue_NabSpecimenId ON nab.cutoffvalue(NabSpecimenId); -GO - -/* nab-14.20-14.30.sql */ - -CREATE SCHEMA nabvirus; -GO - -/* nab-15.10-15.11.sql */ - -CREATE INDEX IDX_NAbSpecimen_SpecimenLSID ON nab.NAbSpecimen(SpecimenLSID); - -/* nab-15.20-15.21.sql */ - -CREATE TABLE nab.DilutionData -( - RowId INT IDENTITY (1, 1) NOT NULL, - Dilution DOUBLE PRECISION, - DilutionOrder INT, - PercentNeutralization DOUBLE PRECISION, - NeutralizationPlusMinus DOUBLE PRECISION, - Min DOUBLE PRECISION, - Max DOUBLE PRECISION, - Mean DOUBLE PRECISION, - StdDev DOUBLE PRECISION, - WellgroupName NVARCHAR(100), - ReplicateName NVARCHAR(100), - RunDataId INT, - MaxDilution DOUBLE PRECISION, - MinDilution DOUBLE PRECISION, - PlateNumber INT, - RunId INT, - ProtocolId INT, - Container ENTITYID NOT NULL, - - CONSTRAINT PK_NAb_DilutionData PRIMARY KEY (RowId) -); - -ALTER TABLE nab.DilutionData ADD CONSTRAINT FK_DilutionData_ExperimentRun FOREIGN KEY (RunId) - REFERENCES Exp.ExperimentRun (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION; -ALTER TABLE nab.DilutionData ADD CONSTRAINT FK_DilutionData_RunDataId FOREIGN KEY (RunDataId) - REFERENCES nab.NAbSpecimen (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION; - -CREATE INDEX IDX_DilutionData_RunId ON nab.DilutionData(RunId); - -CREATE TABLE nab.WellData -( - RowId INT IDENTITY (1, 1) NOT NULL, - RunId INT NOT NULL, - SpecimenLsid LSIDtype NULL, - RunDataId INT NULL, - DilutionDataId INT, - ProtocolId INT, - "Row" INT, - "Column" INT, - Value REAL, - ControlWellgroup NVARCHAR(100), - VirusWellgroup NVARCHAR(100), - SpecimenWellgroup NVARCHAR(100), - ReplicateWellgroup NVARCHAR(100), - ReplicateNumber INT, - Container EntityId NOT NULL, - PlateNumber INT, - PlateVirusName NVARCHAR(100), - - CONSTRAINT PK_NAb_WellData PRIMARY KEY (RowId), - CONSTRAINT FK_WellData_ExperimentRun FOREIGN KEY (RunId) - REFERENCES Exp.ExperimentRun (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT FK_WellData_SpecimenLSID FOREIGN KEY (SpecimenLSID) - REFERENCES Exp.Material (LSID) - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT FK_WellData_RunDataId FOREIGN KEY (RunDataId) - REFERENCES NAb.NAbSpecimen (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT FK_WellData_DilutionDataId FOREIGN KEY (DilutionDataId) - REFERENCES NAb.DilutionData (RowId) - ON UPDATE NO ACTION ON DELETE NO ACTION - -); - -CREATE INDEX IDX_WellData_RunId ON nab.WellData(RunId); - -/* nab-16.20-16.30.sql */ - --- note : nab-16.20-nab-16.21 was backported to release 16.2 to fix issue : 27040 --- when scripts are consolidated for 16.3 we will need to account for both 16.20-16.30 and 16.21-16.30 upgrade paths -CREATE INDEX IDX_WellData_DilutionDataId ON nab.wellData(dilutionDataId); - -GO - --- conditionally create the index, this is necessary because the index creation did not exist initially --- in script: nab-16.20-16.21 but was added later to fix issue 27040 -CREATE PROCEDURE nab.ensureIndex AS - BEGIN - IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'IDX_WellData_DilutionDataId') - BEGIN - execute('CREATE INDEX IDX_WellData_DilutionDataId ON nab.wellData(dilutionDataId)'); - END - END; -GO - -EXEC nab.ensureIndex -GO - -DROP PROCEDURE nab.ensureIndex -GO - -/* nab-16.30-17.10.sql */ - -ALTER TABLE nab.WellData ADD Excluded BIT NOT NULL DEFAULT 0; - -ALTER TABLE nab.NAbSpecimen ADD FitParameters NVARCHAR(500); -GO - -/* 21.xxx SQL scripts */ - -CREATE INDEX IDX_DilutionData_RunDataId ON nab.DilutionData(RunDataId); \ No newline at end of file diff --git a/nab/src/org/labkey/nab/query/NabDilutionDataTable.java b/nab/src/org/labkey/nab/query/NabDilutionDataTable.java index c484a73da..ece3bee7e 100644 --- a/nab/src/org/labkey/nab/query/NabDilutionDataTable.java +++ b/nab/src/org/labkey/nab/query/NabDilutionDataTable.java @@ -38,7 +38,7 @@ public NabDilutionDataTable(final NabProtocolSchema schema, ContainerFilter cf, continue; if ("MaxDilution".equalsIgnoreCase(col.getName())) - continue; // Do with MinDilution to ensure ordering (hack because SqlServer DB order is reversed) + continue; // Added alongside MinDilution below to ensure ordering String name = col.getName(); if ("RunDataId".equalsIgnoreCase(name)) diff --git a/protein/module.properties b/protein/module.properties index b996ddf9f..116c01694 100644 --- a/protein/module.properties +++ b/protein/module.properties @@ -5,5 +5,4 @@ Organization: LabKey OrganizationURL: https://www.labkey.com/ License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 -SupportedDatabases: mssql, pgsql ManageVersion: true diff --git a/protein/resources/schemas/dbscripts/sqlserver/prot-0.000-25.000.sql b/protein/resources/schemas/dbscripts/sqlserver/prot-0.000-25.000.sql deleted file mode 100644 index 1988e5a14..000000000 --- a/protein/resources/schemas/dbscripts/sqlserver/prot-0.000-25.000.sql +++ /dev/null @@ -1,612 +0,0 @@ -/* - * Copyright (c) 2024-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -CREATE SCHEMA prot; -GO - -/****** AnnotInsertions */ -CREATE TABLE prot.AnnotInsertions -( - InsertId INT IDENTITY (1, 1) NOT NULL, - FileName VARCHAR(200) NULL, - FileType VARCHAR(50) NULL, - Comment VARCHAR(200) NULL, - InsertDate DATETIME NULL DEFAULT (getdate()), - ChangeDate DATETIME NULL DEFAULT (getdate()), - Mouthsful INT NULL DEFAULT 0, - RecordsProcessed INT NULL DEFAULT 0, - CompletionDate DATETIME NULL, - SequencesAdded INT NULL DEFAULT 0, - AnnotationsAdded INT NULL DEFAULT 0, - IdentifiersAdded INT NULL DEFAULT 0, - OrganismsAdded INT NULL DEFAULT 0, - MRMSize INT NULL DEFAULT 0, - MRMSequencesAdded INT NULL, - MRMAnnotationsAdded INT NULL, - MRMIdentifiersAdded INT NULL, - MRMOrganismsAdded INT NULL, - DefaultOrganism VARCHAR(100) NULL DEFAULT 'Unknown unknown', - OrgShouldBeGuessed INT NULL DEFAULT 1, - - CONSTRAINT PK_ProtAnnotInsertions PRIMARY KEY CLUSTERED (InsertId) -); - -ALTER TABLE prot.AnnotInsertions ALTER COLUMN FileName NVARCHAR(400); - -/****** InfoSources */ -CREATE TABLE prot.InfoSources -( - SourceId INT IDENTITY (1, 1) NOT NULL, - Name VARCHAR(50) NOT NULL, - CurrentVersion VARCHAR(50) NULL, - CurrentVersionDate DATETIME NULL, - Url VARCHAR(1000) NULL, - ProcessToObtain BINARY(1000) NULL, - LastUpdate DATETIME NULL, - InsertDate DATETIME NULL DEFAULT (getdate()), - ModDate DATETIME NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_SeqSources PRIMARY KEY CLUSTERED (SourceId) -); - -INSERT INTO prot.InfoSources (Name, Url, InsertDate) VALUES ('Genbank', 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=protein&cmd=search&term={}', '2005-03-04 12:08:10'); -INSERT INTO prot.InfoSources (Name, Url, InsertDate) VALUES ('NiceProt', 'http://au.expasy.org/cgi-bin/niceprot.pl?{}', '2005-03-04 12:08:10'); -INSERT INTO prot.InfoSources (Name, Url, InsertDate) VALUES ('GeneCards', 'http://www.genecards.org/cgi-bin/carddisp?{}&alias=yes', '2005-03-04 12:08:10'); -INSERT INTO prot.InfoSources (Name, Url, InsertDate) VALUES ('NCBI Taxonomy', 'http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id={}', '2005-03-04 12:08:10'); -INSERT INTO prot.InfoSources (Name, Url, InsertDate) VALUES ('GO', 'http://amigo.geneontology.org/cgi-bin/amigo/go.cgi?action=query&view=query&query={}', '2005-03-04 12:08:52'); - -UPDATE prot.InfoSources SET Url = 'http://www.genecards.org/cgi-bin/carddisp.pl?gene={}' WHERE Name = 'GeneCards'; -UPDATE prot.InfoSources SET URL = 'http://www.uniprot.org/uniprot/{}' WHERE Name = 'NiceProt'; -UPDATE prot.InfoSources SET URL = 'http://www.ncbi.nlm.nih.gov/protein/{}' WHERE Name = 'Genbank'; -UPDATE prot.infosources SET url = 'http://amigo.geneontology.org/amigo/term/{}' WHERE Name = 'GO'; -GO - -/****** AnnotationTypes */ -CREATE TABLE prot.AnnotationTypes -( - AnnotTypeId INT IDENTITY (1, 1) NOT NULL, - Name VARCHAR(50) NOT NULL, - SourceId INT NULL, - Description VARCHAR(200) NULL, - EntryDate DATETIME NOT NULL DEFAULT (getdate()), - ModDate DATETIME NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtAnnotationTypes PRIMARY KEY CLUSTERED (AnnotTypeId), - CONSTRAINT FK_ProtAnnotationTypes_ProtSeqSources FOREIGN KEY (SourceId) REFERENCES prot.InfoSources (SourceId) -); -CREATE UNIQUE INDEX IX_ProtAnnotationTypes ON prot.AnnotationTypes(Name); - -INSERT INTO prot.AnnotationTypes (Name,SourceId,EntryDate) VALUES ('GO_F',5,'2005-03-04 11:37:15'); -INSERT INTO prot.AnnotationTypes (Name,SourceId,EntryDate) VALUES ('GO_P',5,'2005-03-04 11:37:15'); -INSERT INTO prot.AnnotationTypes (Name,EntryDate) VALUES ('keyword','2005-03-04 11:37:15'); -INSERT INTO prot.AnnotationTypes (Name,EntryDate) VALUES ('feature','2005-03-04 11:37:15'); -INSERT INTO prot.AnnotationTypes (Name,SourceId,EntryDate) VALUES ('GO_C',5,'2005-03-04 11:38:13'); -INSERT INTO prot.AnnotationTypes (Name) VALUES ('FullOrganismName'); -INSERT INTO prot.AnnotationTypes (Name) VALUES ('LookupString'); - -CREATE INDEX IX_AnnotationTypes_SourceId ON prot.annotationtypes(SourceId); - -/****** IdentTypes */ -CREATE TABLE prot.IdentTypes -( - IdentTypeId INT IDENTITY (1, 1) NOT NULL, - Name VARCHAR(50) NOT NULL, - CannonicalSourceId INT NULL, - EntryDate DATETIME NOT NULL DEFAULT (getdate()), - Description VARCHAR(200) NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtIdentTypes PRIMARY KEY CLUSTERED (IdentTypeId), - CONSTRAINT FK_ProtIdentTypes_ProtInfoSources FOREIGN KEY (CannonicalSourceId) REFERENCES prot.InfoSources (SourceId) -); -CREATE UNIQUE INDEX IX_ProtIdentTypes ON prot.IdentTypes(Name); - -INSERT INTO prot.IdentTypes (Name,CannonicalSourceId,EntryDate) VALUES ('Genbank',1,'2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,CannonicalSourceId,EntryDate) VALUES ('SwissProt',2,'2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,CannonicalSourceId,EntryDate) VALUES ('GeneName',3,'2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,CannonicalSourceId,EntryDate) VALUES ('NCBI Taxonomy',4,'2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('EMBL','2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('IntAct','2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Ensembl','2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('FlyBase','2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,CannonicalSourceId,EntryDate) VALUES ('GO',5,'2005-03-04 11:37:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('InterPro','2005-03-04 11:37:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Pfam','2005-03-04 11:37:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PIR','2005-03-04 11:37:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Uniprot_keyword','2005-03-04 11:37:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('SMART','2005-03-04 11:37:16'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('HSSP','2005-03-04 11:37:17'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('ProDom','2005-03-04 11:37:17'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PROSITE','2005-03-04 11:37:17'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PRINTS','2005-03-04 11:37:19'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('TIGRFAMs','2005-03-04 11:37:22'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('EC','2005-03-04 11:37:22'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('MaizeDB','2005-03-04 11:37:33'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('TRANSFAC','2005-03-04 11:37:34'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('WormBase','2005-03-04 11:37:38'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('WormPep','2005-03-04 11:37:39'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('COMPLUYEAST-2DPAGE','2005-03-04 11:37:39'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('DictyBase','2005-03-04 11:37:40'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Gramene','2005-03-04 11:37:45'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('OGP','2005-03-04 11:38:02'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Genew','2005-03-04 11:38:02'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('H-InvDB','2005-03-04 11:38:02'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('MIM','2005-03-04 11:38:02'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('MGD','2005-03-04 11:38:04'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('RGD','2005-03-04 11:38:06'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PDB','2005-03-04 11:38:10'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('SWISS-2DPAGE','2005-03-04 11:38:33'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Aarhus/Ghent-2DPAGE','2005-03-04 11:38:33'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PMMA-2DPAGE','2005-03-04 11:38:45'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('TIGR','2005-03-04 11:38:49'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('TubercuList','2005-03-04 11:38:50'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Leproma','2005-03-04 11:39:05'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('GeneFarm','2005-03-04 11:39:35'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('GermOnline','2005-03-04 11:43:54'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('SGD','2005-03-04 11:43:54'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('GeneDB_SPombe','2005-03-04 11:44:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PIRSF','2005-03-04 11:45:42'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('HAMAP','2005-03-04 11:46:49'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Reactome','2005-03-04 11:46:52'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('ECO2DBASE','2005-03-04 11:46:55'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('EchoBASE','2005-03-04 11:46:55'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('EcoGene','2005-03-04 11:46:55'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('SubtiList','2005-03-04 11:46:58'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('ListiList','2005-03-04 11:47:14'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('GlycoSuiteDB','2005-03-04 11:47:44'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('StyGene','2005-03-04 11:51:59'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PHCI-2DPAGE','2005-03-04 11:52:19'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Siena-2DPAGE','2005-03-04 11:55:22'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('HSC-2DPAGE','2005-03-04 11:55:41'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('MEROPS','2005-03-04 11:59:32'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('AGD','2005-03-04 12:14:40'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PhotoList','2005-03-04 12:15:22'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('ZFIN','2005-03-04 12:15:39'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('MypuList','2005-03-04 12:24:15'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('SagaList','2005-03-04 12:25:40'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('ANU-2DPAGE','2005-03-04 12:29:22'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Rat-heart-2DPAGE','2005-03-04 12:30:51'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('PhosSite','2005-03-04 12:49:00'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('REBASE','2005-03-04 13:25:29'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('Maize-2DPAGE','2005-03-04 15:10:53'); -INSERT INTO prot.IdentTypes (Name,EntryDate) VALUES ('HIV','2005-03-04 22:13:40'); - -CREATE INDEX IX_IdentTypes_cannonicalsourceid ON prot.IdentTypes(cannonicalsourceid); - -/****** Sequences */ -CREATE TABLE prot.Sequences -( - SeqId INT IDENTITY (1, 1) NOT NULL, - ProtSequence TEXT NULL, - Hash VARCHAR(100) NULL, - Description VARCHAR(200) NULL, - SourceId INT NULL, - SourceVersion VARCHAR(50) NULL, - InsertDate DATETIME NULL DEFAULT (getdate()), - ChangeDate DATETIME NULL, - SourceChangeDate DATETIME NULL, - SourceInsertDate DATETIME NULL, - OrgId INT NULL, - Mass FLOAT NULL, - BestName VARCHAR(50) NULL, - BestGeneName VARCHAR(50) NULL, - Length INT NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtSequences PRIMARY KEY CLUSTERED (SeqId), - CONSTRAINT FK_ProtSequences_ProtSeqSources FOREIGN KEY (SourceId) REFERENCES prot.InfoSources (SourceId) -); -CREATE INDEX IX_SequencesOrg ON prot.Sequences(OrgId); -CREATE INDEX IX_ProtSequences_BestGeneName ON prot.Sequences(BestGeneName); -CREATE UNIQUE INDEX IX_ProtSequencesSurrogateKey ON prot.Sequences(Hash, OrgId); - --- Issue 26074: Equals filter fails on protein.Sequence.ProtSequence column on SqlServer -ALTER TABLE prot.Sequences ALTER COLUMN ProtSequence VARCHAR(MAX); - -/****** Identifiers */ -CREATE TABLE prot.Identifiers -( - IdentId INT IDENTITY (1, 1) NOT NULL, - IdentTypeId INT NOT NULL, - Identifier VARCHAR(50) NOT NULL, - SeqId INT NULL, - SourceId INT NULL, - EntryDate DATETIME NOT NULL DEFAULT (getdate()), - SourceVersion VARCHAR(50) NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtIdentifiers PRIMARY KEY CLUSTERED (IdentId), - CONSTRAINT FK_ProtIdentifiers_ProtIdentTypes FOREIGN KEY (IdentTypeId) REFERENCES prot.IdentTypes (IdentTypeId), - CONSTRAINT FK_ProtIdentifiers_ProtSeqSources FOREIGN KEY (SourceId) REFERENCES prot.InfoSources (SourceId), - CONSTRAINT FK_ProtIdentifiers_ProtSequences FOREIGN KEY (SeqId) REFERENCES prot.Sequences (SeqId) -); -CREATE INDEX IX_Identifier ON prot.Identifiers(Identifier); -CREATE UNIQUE INDEX IX_ProtIdentifiers ON prot.Identifiers(IdentTypeId, Identifier, SeqId); -CREATE INDEX IX_Identifiers_SourceId ON prot.Identifiers(sourceid); -CREATE INDEX IX_Identifiers_SeqId ON prot.Identifiers(SeqId); - -/****** Organisms */ -CREATE TABLE prot.Organisms -( - OrgId INT IDENTITY (1, 1) NOT NULL, - CommonName VARCHAR(100) NULL, - Genus VARCHAR(100) NOT NULL, - Species VARCHAR(100) NOT NULL, - Comments VARCHAR(200) NULL, - IdentId INT NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtOrganisms PRIMARY KEY CLUSTERED (OrgId), - CONSTRAINT FK_ProtOrganisms_ProtIdentifiers FOREIGN KEY (IdentId) REFERENCES prot.Identifiers (IdentId), - CONSTRAINT FK_ProtSequences_ProtOrganisms FOREIGN KEY (OrgId) REFERENCES prot.Organisms (OrgId) -); -CREATE UNIQUE INDEX IX_ProtOrganismsSurrogateKey ON prot.Organisms(Genus, Species); - -INSERT INTO prot.Organisms (CommonName, Genus, Species, Comments) VALUES ('Unknown organism', 'Unknown', 'unknown', 'Organism is unknown'); - -CREATE INDEX IX_Organisms_IdentId ON prot.Organisms(IdentId); - -/****** Annotations */ -CREATE TABLE prot.Annotations -( - AnnotId INT IDENTITY (1, 1) NOT NULL, - AnnotTypeId INT NOT NULL, - AnnotVal VARCHAR(200) NULL, - AnnotIdent INT NULL, - SeqId INT NULL, - AnnotSourceId INT NULL, - AnnotSourceVersion VARCHAR(50) NULL, - InsertDate DATETIME NOT NULL DEFAULT (getdate()), - ModDate DATETIME NULL, - StartPos INT NULL, - EndPos INT NULL, - Deleted BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProtAnnotations PRIMARY KEY CLUSTERED (AnnotId), - CONSTRAINT FK_ProtAnnotations_ProtAnnotationTypes FOREIGN KEY (AnnotTypeId) REFERENCES prot.AnnotationTypes (AnnotTypeId), - CONSTRAINT FK_ProtAnnotations_ProtIdentifiers FOREIGN KEY (AnnotIdent) REFERENCES prot.Identifiers (IdentId), - CONSTRAINT FK_ProtAnnotations_ProtSeqSources FOREIGN KEY (AnnotSourceId) REFERENCES prot.InfoSources (SourceId), - CONSTRAINT FK_ProtAnnotations_ProtSequences FOREIGN KEY (SeqId) REFERENCES prot.Sequences (SeqId) -) -CREATE INDEX IX_ProtAnnotations1 ON prot.Annotations(SeqId, AnnotTypeId) -CREATE UNIQUE INDEX IX_AnnotSurrogateKey ON prot.Annotations(AnnotTypeId, AnnotVal, SeqId, StartPos, EndPos); -CREATE INDEX IX_Annotations_AnnotVal ON prot.Annotations(annotval); -CREATE INDEX IX_Annotations_AnnotIdent ON prot.annotations(annotident); -CREATE INDEX IX_Annotations_annotsourceid ON prot.annotations(annotsourceid); -CREATE INDEX IX_Annotations_IdentId ON prot.annotations(AnnotIdent); - -/****** FastaLoads */ -CREATE TABLE prot.FastaLoads -( - FastaId INT IDENTITY (1, 1) NOT NULL, - FileName VARCHAR(200) NOT NULL, - FileChecksum VARCHAR(50) NULL, - Comment VARCHAR(200) NULL, - InsertDate DATETIME NULL DEFAULT (getdate()), - DbName VARCHAR(100) NULL, - DbVersion VARCHAR(100) NULL, - DbSource INT NULL, - DbDate DATETIME NULL, - Reference VARCHAR(200) NULL, - NSequences INT NULL, - Sequences IMAGE NULL, - - CONSTRAINT FK_ProtFastas_ProtSeqSources FOREIGN KEY (DbSource) REFERENCES prot.InfoSources (SourceId), - CONSTRAINT PK_ProtFastas PRIMARY KEY CLUSTERED (FastaId) -); - -CREATE INDEX IX_FastaLoads_DBSource ON prot.FastaLoads(dbsource); - -/****** SprotOrgMap */ -CREATE TABLE prot.SprotOrgMap -( - SprotSuffix VARCHAR(5) NOT NULL, - SuperKingdomCode CHAR(1) NULL, - TaxonId INT NULL, - FullName VARCHAR(200) NOT NULL, - Genus VARCHAR(100) NOT NULL, - Species VARCHAR(100) NOT NULL, - CommonName VARCHAR(200) NULL, - Synonym VARCHAR(200) NULL, - - CONSTRAINT PK_ProtSprotOrgMap PRIMARY KEY (SprotSuffix) -); - -CREATE TABLE prot.FastaFiles -( - FastaId INT IDENTITY (1, 1) NOT NULL, - FileName NVARCHAR (400), - Loaded DATETIME, - FileChecksum VARCHAR(50) NULL, -- Hash of the file - ScoringAnalysis BIT NOT NULL DEFAULT 0, - - CONSTRAINT PK_ProteinDataBases PRIMARY KEY (FastaId) -); - --- All tables used for GO data --- Data will change frequently, with updates from the GO consortium --- See http://www.geneontology.org/GO.downloads.shtml - --- GO Terms - -CREATE TABLE prot.GoTerm -( - id INTEGER NOT NULL, - name VARCHAR(255) NOT NULL DEFAULT '', - termtype VARCHAR(55) NOT NULL DEFAULT '', - acc VARCHAR(255) NOT NULL DEFAULT '', - isobsolete INTEGER NOT NULL DEFAULT 0, - isroot INTEGER NOT NULL DEFAULT 0, - - CONSTRAINT PK_GoTerm PRIMARY KEY(id) -); -CREATE INDEX IX_GoTerm_Name ON prot.GoTerm(name); -CREATE INDEX IX_GoTerm_TermType ON prot.GoTerm(termtype); -CREATE UNIQUE INDEX UQ_GoTerm_Acc ON prot.GoTerm(acc); - --- GO Term2Term - -CREATE TABLE prot.GoTerm2Term -( - id INTEGER NOT NULL, - relationshipTypeId INTEGER NOT NULL DEFAULT 0, - term1Id INTEGER NOT NULL DEFAULT 0, - term2Id INTEGER NOT NULL DEFAULT 0, - complete INTEGER NOT NULL DEFAULT 0, - - CONSTRAINT PK_GoTerm2Term PRIMARY KEY(id) -); - -CREATE INDEX IX_GoTerm2Term_term1Id ON prot.GoTerm2Term(term1Id); -CREATE INDEX IX_GoTerm2Term_term2Id ON prot.GoTerm2Term(term2Id); -CREATE INDEX IX_GoTerm2Term_term1_2_Id ON prot.GoTerm2Term(term1Id, term2Id); -CREATE INDEX IX_GoTerm2Term_relationshipTypeId ON prot.GoTerm2Term(relationshipTypeId); -CREATE UNIQUE INDEX UQ_GoTerm2Term_1_2_R ON prot.GoTerm2Term(term1Id, term2Id, relationshipTypeId); - --- Graph path - -CREATE TABLE prot.GoGraphPath -( - id INTEGER NOT NULL, - term1Id INTEGER NOT NULL DEFAULT 0, - term2Id INTEGER NOT NULL DEFAULT 0, - distance INTEGER NOT NULL DEFAULT 0, - - CONSTRAINT PK_GoGraphPath PRIMARY KEY(id) -); - -CREATE INDEX IX_GoGraphPath_term1Id ON prot.GoGraphPath(term1Id); -CREATE INDEX IX_GoGraphPath_term2Id ON prot.GoGraphPath(term2Id); -CREATE INDEX IX_GoGraphPath_term1_2_Id ON prot.GoGraphPath(term1Id, term2Id); -CREATE INDEX IX_GoGraphPath_t1_distance ON prot.GoGraphPath(term1Id, distance); - --- Go term definitions - -CREATE TABLE prot.GoTermDefinition -( - termId INTEGER NOT NULL DEFAULT 0, - termDefinition text NOT NULL, - dbXrefId INTEGER NULL DEFAULT NULL, - termComment text NULL DEFAULT NULL, - reference VARCHAR(255) NULL DEFAULT NULL -); - -CREATE INDEX IX_GoTermDefinition_dbXrefId ON prot.GoTermDefinition(dbXrefId); -CREATE UNIQUE INDEX UQ_GoTermDefinition_termId ON prot.GoTermDefinition(termId); - --- GO term synonyms - -CREATE TABLE prot.GoTermSynonym -( - TermId INTEGER NOT NULL DEFAULT 0, - TermSynonym VARCHAR(500) NULL DEFAULT NULL, - AccSynonym VARCHAR(255) NULL DEFAULT NULL, - SynonymTypeId INTEGER NOT NULL DEFAULT 0 -); -CREATE INDEX IX_GoTermSynonym_SynonymTypeId ON prot.GoTermSynonym(SynonymTypeId); -CREATE INDEX IX_GoTermSynonym_TermId ON prot.GoTermSynonym(TermId); -CREATE INDEX IX_GoTermSynonym_termSynonym ON prot.GoTermSynonym(TermSynonym); -CREATE UNIQUE INDEX UQ_GoTermSynonym_termId_termSynonym ON prot.GoTermSynonym(TermId, TermSynonym); - -GO - -CREATE PROCEDURE prot.create_go_indexes AS -BEGIN - ALTER TABLE prot.goterm ADD CONSTRAINT pk_goterm PRIMARY KEY (id) - CREATE INDEX IX_GoTerm_Name ON prot.GoTerm(name) - CREATE INDEX IX_GoTerm_TermType ON prot.GoTerm(termtype) - CREATE UNIQUE INDEX UQ_GoTerm_Acc ON prot.GoTerm(acc) - - ALTER TABLE prot.goterm2term ADD CONSTRAINT pk_goterm2term PRIMARY KEY (id) - CREATE INDEX IX_GoTerm2Term_term1Id ON prot.GoTerm2Term(term1Id) - CREATE INDEX IX_GoTerm2Term_term2Id ON prot.GoTerm2Term(term2Id) - CREATE INDEX IX_GoTerm2Term_term1_2_Id ON prot.GoTerm2Term(term1Id,term2Id) - CREATE INDEX IX_GoTerm2Term_relationshipTypeId ON prot.GoTerm2Term(relationshipTypeId) - CREATE UNIQUE INDEX UQ_GoTerm2Term_1_2_R ON prot.GoTerm2Term(term1Id,term2Id,relationshipTypeId) - - ALTER TABLE prot.gographpath ADD CONSTRAINT pk_gographpath PRIMARY KEY (id) - CREATE INDEX IX_GoGraphPath_term1Id ON prot.GoGraphPath(term1Id) - CREATE INDEX IX_GoGraphPath_term2Id ON prot.GoGraphPath(term2Id) - CREATE INDEX IX_GoGraphPath_term1_2_Id ON prot.GoGraphPath(term1Id,term2Id) - CREATE INDEX IX_GoGraphPath_t1_distance ON prot.GoGraphPath(term1Id,distance) - - CREATE INDEX IX_GoTermDefinition_dbXrefId ON prot.GoTermDefinition(dbXrefId) - CREATE UNIQUE INDEX UQ_GoTermDefinition_termId ON prot.GoTermDefinition(termId) - - CREATE INDEX IX_GoTermSynonym_SynonymTypeId ON prot.GoTermSynonym(synonymTypeId) - CREATE INDEX IX_GoTermSynonym_TermId ON prot.GoTermSynonym(termId) - CREATE INDEX IX_GoTermSynonym_termSynonym ON prot.GoTermSynonym(termSynonym) - CREATE UNIQUE INDEX UQ_GoTermSynonym_termId_termSynonym ON prot.GoTermSynonym(termId,termSynonym); -END - -GO - -CREATE PROCEDURE prot.drop_go_indexes AS -BEGIN - EXEC core.fn_dropifexists 'goterm', 'prot', 'Constraint', 'PK_GoTerm' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'IX_GoTerm_Name' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'IX_GoTerm_TermType' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'UQ_GoTerm_Acc' - - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Constraint', 'PK_GoTerm2Term' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_term1Id' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_term2Id' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_term1_2_Id' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_relationshipTypeId' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'UQ_GoTerm2Term_1_2_R' - - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Constraint', 'PK_GoGraphPath' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_term1Id' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_term2Id' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_term1_2_Id' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_t1_distance' - - EXEC core.fn_dropifexists 'gotermdefinition', 'prot', 'Index', 'IX_GoTermDefinition_dbXrefId' - EXEC core.fn_dropifexists 'gotermdefinition', 'prot', 'Index', 'UQ_GoTermDefinition_termId' - - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'IX_GoTermSynonym_SynonymTypeId' - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'IX_GoTermSynonym_TermId' - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'IX_GoTermSynonym_termSynonym' - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'UQ_GoTermSynonym_termId_termSynonym'; -END - -GO - --- add most common ncbi Taxonomy id's -CREATE TABLE prot.idents -( - RowId INT NOT NULL IDENTITY, - Identifier VARCHAR(50) NOT NULL, - CommonName VARCHAR(20) NULL, - Genus VARCHAR(100) NOT NULL, - Species VARCHAR(100) NOT NULL, - OrgId INT NULL, - IdentId INT NULL, - IdentTypeId INT NULL -); - -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('chicken', 'Gallus', 'gallus', '9031'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('chimp', 'Pan', 'troglodytes', '9598'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('cow', 'Bos', 'taurus', '9913'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('dog', 'Canis', 'familiaris', '9615'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('ecoli', 'Escherichia', 'coli', '562'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('fruit fly', 'Drosophila', 'melanogaster', '7227'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('horse', 'Equus', 'caballus', '9796'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('human', 'Homo', 'sapiens', '9606'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('mouse', 'Mus', 'musculus', '10090'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('nematode', 'Caenorhabditis', 'elegans', '6239'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('pig', 'Sus', 'scrofa', '9823'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('rat', 'Rattus', 'norvegicus', '10116'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('yeast', 'Saccharomyces', 'cerevisiae', '4932'); -INSERT prot.idents (CommonName, Genus, Species, Identifier) -VALUES ('zebrafish', 'Danio', 'rerio', '7955'); - -UPDATE prot.idents SET IdentTypeId = (SELECT identtypeid FROM prot.IdentTypes WHERE name='NCBI Taxonomy'); - -INSERT prot.Organisms (CommonName, Genus, Species) - SELECT CommonName, Genus, Species FROM prot.idents - WHERE NOT EXISTS - (SELECT * FROM prot.Organisms PO INNER JOIN prot.idents i ON (PO.Genus = i.Genus AND PO.Species = i.Species)); - -INSERT prot.Identifiers (Identifier, IdentTypeId) - SELECT Identifier, IdentTypeId FROM prot.idents - WHERE NOT EXISTS - (SELECT * FROM prot.Identifiers PI INNER JOIN prot.idents i ON (PI.Identifier = i.Identifier AND PI.IdentTypeId = i.IdentTypeId)); - -UPDATE prot.idents - SET OrgId = PO.OrgId - FROM prot.Organisms PO - WHERE prot.idents.Genus = PO.Genus AND prot.idents.Species = PO.Species; - -UPDATE prot.idents - SET IdentId = PI.IdentId - FROM prot.Identifiers PI - WHERE prot.idents.Identifier = PI.Identifier AND prot.idents.IdentTypeId = PI.IdentTypeId; - -UPDATE prot.Organisms - SET IdentId = i.IdentID - FROM prot.idents i - WHERE i.OrgId = prot.Organisms.OrgId; - -DROP TABLE prot.idents -GO - --- Bug 2195 restructure prot.FastaSequences -CREATE TABLE prot.FastaSequences -( - FastaId INT NOT NULL, - LookupString VARCHAR (200) NOT NULL, - SeqId INT NULL, - - CONSTRAINT PK_FastaSequences PRIMARY KEY (LookupString, FastaId), - CONSTRAINT FK_FastaSequences_Sequences FOREIGN KEY (SeqId) REFERENCES prot.Sequences (SeqId) -); - -CREATE INDEX IX_FastaSequences_FastaId_SeqId ON prot.FastaSequences(FastaId, SeqId) -CREATE INDEX IX_FastaSequences_SeqId ON prot.FastaSequences(SeqId) - ---Bug 2193 -CREATE INDEX IX_SequencesSource ON prot.Sequences(SourceId); - -CREATE TABLE prot.CustomAnnotationSet -( - CustomAnnotationSetId INT IDENTITY(1, 1) NOT NULL, - Container EntityId NOT NULL, - Name VARCHAR(200) NOT NULL, - CreatedBy USERID, - Created DATETIME, - ModifiedBy USERID, - Modified DATETIME, - CustomAnnotationType VARCHAR(20) NOT NULL, - Lsid lsidtype, - - CONSTRAINT PK_CustomAnnotationSet PRIMARY KEY (CustomAnnotationSetId), - CONSTRAINT FK_CustomAnnotationSet_Container FOREIGN KEY (Container) REFERENCES core.Containers(EntityId), - CONSTRAINT UQ_CustomAnnotationSet UNIQUE (Container, Name) -); - -CREATE INDEX IX_CustomAnnotationSet_Container ON prot.CustomAnnotationSet(Container); - -CREATE TABLE prot.CustomAnnotation -( - CustomAnnotationId INT IDENTITY(1, 1) NOT NULL, - CustomAnnotationSetId INT NOT NULL, - ObjectURI LsidType NOT NULL, - LookupString VARCHAR(200) NOT NULL, - - CONSTRAINT PK_CustomAnnotation PRIMARY KEY (CustomAnnotationId), - CONSTRAINT fk_CustomAnnotation_CustomAnnotationSetId FOREIGN KEY (CustomAnnotationSetId) REFERENCES prot.CustomAnnotationSet(CustomAnnotationSetId), - CONSTRAINT UQ_CustomAnnotation_LookupString_SetId UNIQUE (LookupString, CustomAnnotationSetId), - CONSTRAINT UQ_CustomAnnotation_ObjectURI UNIQUE (ObjectURI) -); - -CREATE INDEX IX_CustomAnnotation_CustomAnnotationSetId ON prot.CustomAnnotation(CustomAnnotationSetId); -GO diff --git a/protein/resources/schemas/dbscripts/sqlserver/prot-25.000-25.001.sql b/protein/resources/schemas/dbscripts/sqlserver/prot-25.000-25.001.sql deleted file mode 100644 index 264d9de19..000000000 --- a/protein/resources/schemas/dbscripts/sqlserver/prot-25.000-25.001.sql +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ --- These columns are unused and, due to data type differences, are problematic for SQL Server -> PostgreSQL migration -EXEC core.fn_dropifexists 'InfoSources', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'AnnotationTypes', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'IdentTypes', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'Organisms', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'Sequences', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'Identifiers', 'prot', 'COLUMN', 'Deleted'; -EXEC core.fn_dropifexists 'Annotations', 'prot', 'COLUMN', 'Deleted'; diff --git a/protein/resources/schemas/dbscripts/sqlserver/prot-25.001-25.002.sql b/protein/resources/schemas/dbscripts/sqlserver/prot-25.001-25.002.sql deleted file mode 100644 index d9843948d..000000000 --- a/protein/resources/schemas/dbscripts/sqlserver/prot-25.001-25.002.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ --- Move foreign key to the correct table. Issue 53523. -ALTER TABLE prot.Organisms DROP CONSTRAINT FK_ProtSequences_ProtOrganisms; -ALTER TABLE prot.Sequences ADD CONSTRAINT FK_ProtSequences_ProtOrganisms FOREIGN KEY (OrgId) REFERENCES prot.Organisms (OrgId); diff --git a/protein/resources/schemas/dbscripts/sqlserver/prot-25.002-25.003.sql b/protein/resources/schemas/dbscripts/sqlserver/prot-25.002-25.003.sql deleted file mode 100644 index 79f5f5769..000000000 --- a/protein/resources/schemas/dbscripts/sqlserver/prot-25.002-25.003.sql +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2025-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ --- This index overlaps with IX_Annotations_AnnotIdent -DROP INDEX IX_Annotations_IdentId ON prot.Annotations; --- This index overlaps with IX_GoGraphPath_term1_2_Id and IX_GoGraphPath_t1_distance -DROP INDEX IX_GoGraphPath_term1Id ON prot.GoGraphPath; --- This index overlaps with UQ_CustomAnnotationSet -DROP INDEX IX_CustomAnnotationSet_Container ON prot.CustomAnnotationSet; --- This index overlaps with UQ_GoTerm2Term_1_2_R -DROP INDEX IX_GoTerm2Term_term1Id ON prot.GoTerm2Term; --- This index overlaps with UQ_GoTerm2Term_1_2_R -DROP INDEX IX_GoTerm2Term_term1_2_Id ON prot.GoTerm2Term; --- This index overlaps with UQ_GoTermSynonym_termId_termSynonym -DROP INDEX IX_GoTermSynonym_TermId ON prot.GoTermSynonym; - -GO - -ALTER PROCEDURE prot.create_go_indexes AS -BEGIN - ALTER TABLE prot.goterm ADD CONSTRAINT pk_goterm PRIMARY KEY (id) - CREATE INDEX IX_GoTerm_Name ON prot.GoTerm(name) - CREATE INDEX IX_GoTerm_TermType ON prot.GoTerm(termtype) - CREATE UNIQUE INDEX UQ_GoTerm_Acc ON prot.GoTerm(acc) - - ALTER TABLE prot.goterm2term ADD CONSTRAINT pk_goterm2term PRIMARY KEY (id) - CREATE INDEX IX_GoTerm2Term_term2Id ON prot.GoTerm2Term(term2Id) - CREATE INDEX IX_GoTerm2Term_relationshipTypeId ON prot.GoTerm2Term(relationshipTypeId) - CREATE UNIQUE INDEX UQ_GoTerm2Term_1_2_R ON prot.GoTerm2Term(term1Id,term2Id,relationshipTypeId) - - ALTER TABLE prot.gographpath ADD CONSTRAINT pk_gographpath PRIMARY KEY (id) - CREATE INDEX IX_GoGraphPath_term2Id ON prot.GoGraphPath(term2Id) - CREATE INDEX IX_GoGraphPath_term1_2_Id ON prot.GoGraphPath(term1Id,term2Id) - CREATE INDEX IX_GoGraphPath_t1_distance ON prot.GoGraphPath(term1Id,distance) - - CREATE INDEX IX_GoTermDefinition_dbXrefId ON prot.GoTermDefinition(dbXrefId) - CREATE UNIQUE INDEX UQ_GoTermDefinition_termId ON prot.GoTermDefinition(termId) - - CREATE INDEX IX_GoTermSynonym_SynonymTypeId ON prot.GoTermSynonym(synonymTypeId) - CREATE INDEX IX_GoTermSynonym_termSynonym ON prot.GoTermSynonym(termSynonym) - CREATE UNIQUE INDEX UQ_GoTermSynonym_termId_termSynonym ON prot.GoTermSynonym(termId,termSynonym); -END - -GO - -ALTER PROCEDURE prot.drop_go_indexes AS -BEGIN - EXEC core.fn_dropifexists 'goterm', 'prot', 'Constraint', 'PK_GoTerm' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'IX_GoTerm_Name' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'IX_GoTerm_TermType' - EXEC core.fn_dropifexists 'goterm', 'prot', 'Index', 'UQ_GoTerm_Acc' - - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Constraint', 'PK_GoTerm2Term' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_term2Id' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'IX_GoTerm2Term_relationshipTypeId' - EXEC core.fn_dropifexists 'goterm2term', 'prot', 'Index', 'UQ_GoTerm2Term_1_2_R' - - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Constraint', 'PK_GoGraphPath' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_term2Id' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_term1_2_Id' - EXEC core.fn_dropifexists 'gographpath', 'prot', 'Index', 'IX_GoGraphPath_t1_distance' - - EXEC core.fn_dropifexists 'gotermdefinition', 'prot', 'Index', 'IX_GoTermDefinition_dbXrefId' - EXEC core.fn_dropifexists 'gotermdefinition', 'prot', 'Index', 'UQ_GoTermDefinition_termId' - - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'IX_GoTermSynonym_SynonymTypeId' - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'IX_GoTermSynonym_termSynonym' - EXEC core.fn_dropifexists 'gotermsynonym', 'prot', 'Index', 'UQ_GoTermSynonym_termId_termSynonym'; -END - -GO diff --git a/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataFileWatcherTest.java b/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataFileWatcherTest.java index 79e56f5cb..4b214dc7f 100644 --- a/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataFileWatcherTest.java +++ b/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataFileWatcherTest.java @@ -30,7 +30,6 @@ import org.labkey.test.util.DataRegionTable; import org.labkey.test.util.PipelineStatusTable; import org.labkey.test.util.PortalHelper; -import org.labkey.test.util.PostgresOnlyTest; import org.labkey.test.util.core.webdav.WebDavUploadHelper; import org.labkey.test.util.data.TestDataUtils; import org.labkey.test.util.query.QueryUtils; @@ -48,7 +47,7 @@ @Category({Git.class}) @BaseWebDriverTest.ClassTimeout(minutes = 10) -public class SignalDataFileWatcherTest extends BaseWebDriverTest implements PostgresOnlyTest +public class SignalDataFileWatcherTest extends BaseWebDriverTest { private static final String PROJECT_NAME = "SignalDataFileWatcherTest"; private static final String DEFAULT_RUN = "TestRun001"; diff --git a/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataRawTest.java b/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataRawTest.java index ddfed8857..c87c9bac4 100644 --- a/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataRawTest.java +++ b/signalData/test/src/org/labkey/test/tests/signaldata/SignalDataRawTest.java @@ -33,7 +33,6 @@ import org.labkey.test.params.FieldDefinition; import org.labkey.test.util.DataRegionTable; import org.labkey.test.util.Ext4Helper; -import org.labkey.test.util.PostgresOnlyTest; import org.labkey.test.util.data.TestDataUtils; import org.labkey.test.util.signaldata.SignalDataInitializer; import org.openqa.selenium.WebElement; @@ -51,7 +50,7 @@ import static org.junit.Assert.assertTrue; @Category({Daily.class}) -public class SignalDataRawTest extends BaseWebDriverTest implements PostgresOnlyTest +public class SignalDataRawTest extends BaseWebDriverTest { private static final String PROJECT_NAME = "SignalDataRawTest"; private static final String DEFAULT_RUN = "TestRun001";