Skip to content

Commit dbf04d7

Browse files
authored
Drop unused elispotlk.rundata.ObjectId column and other cruft (#914)
1 parent 37b33ad commit dbf04d7

10 files changed

Lines changed: 46 additions & 161 deletions

File tree

elispotassay/resources/schemas/dbscripts/postgresql/elispotlk-0.00-18.30.sql

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
/* elispotlk-15.10-15.20.sql */
18-
1917
CREATE SCHEMA elispotlk;
20-
-- Until 21.11.5, the elispotassay module did not claim ownership of the "elispotantigen" schema. So, deleting that
21-
-- module and its schema would leave "elispotantigen" behind and any subsequent bootstrap would fail. See #44610.
22-
SELECT core.fn_dropIfExists('*', 'elispotantigen', 'SCHEMA', NULL);
2318
CREATE SCHEMA elispotantigen;
2419

2520
CREATE TABLE elispotlk.rundata
@@ -51,33 +46,5 @@ CREATE TABLE elispotlk.rundata
5146

5247
CREATE INDEX idx_elispotrundata_runid ON elispotlk.rundata(RunId);
5348

54-
INSERT INTO elispotlk.rundata (RunId, Specimenlsid, SpotCount, WellgroupName, WellgroupLocation, NormalizedSpotCount, AntigenWellgroupName, ObjectUri, ObjectId)
55-
SELECT
56-
RunId,SpecimenLSID, SpotCount, WellGroupName, WellgroupLocation, NormalizedSpotCount,
57-
CASE WHEN AntigenWellgroupNameTemp IS NULL THEN AntigenName ELSE AntigenWellgroupNameTemp END AS AntigenWellgroupName,
58-
ObjectURI, ObjectId
59-
FROM (
60-
SELECT
61-
(SELECT RunId FROM exp.Data d, exp.Object parent WHERE d.LSID = parent.ObjectURI and parent.ObjectId = o.OwnerObjectId) AS RunId,
62-
63-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
64-
WHERE pd.PropertyURI LIKE '%:SpecimenLsid' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS SpecimenLSID,
65-
(SELECT FloatValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
66-
WHERE pd.PropertyURI LIKE '%:SpotCount' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS SpotCount,
67-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
68-
WHERE pd.PropertyURI LIKE '%:WellgroupName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS WellGroupName,
69-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
70-
WHERE pd.PropertyURI LIKE '%:WellgroupLocation' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS WellgroupLocation,
71-
(SELECT FloatValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
72-
WHERE pd.PropertyURI LIKE '%:NormalizedSpotCount' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS NormalizedSpotCount,
73-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
74-
WHERE pd.PropertyURI LIKE '%:AntigenWellgroupName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS AntigenWellgroupNameTemp,
75-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
76-
WHERE pd.PropertyURI LIKE '%:AntigenName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS AntigenName,
77-
ObjectURI,
78-
ObjectId
79-
FROM exp.Object o WHERE ObjectURI LIKE '%ElispotAssayDataRow%') x
80-
WHERE specimenlsid IS NOT NULL AND RunID IS NOT NULL;
81-
8249
ALTER TABLE elispotlk.rundata ADD COLUMN Cytokine VARCHAR(4000);
83-
ALTER TABLE elispotlk.rundata ADD COLUMN SpotSize REAL;
50+
ALTER TABLE elispotlk.rundata ADD COLUMN SpotSize REAL;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2015-2018 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
-- Drop unused column
18+
ALTER TABLE elispotlk.rundata DROP COLUMN ObjectId;

elispotassay/resources/schemas/dbscripts/sqlserver/elispotlk-0.00-18.30.sql

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
/* elispotlk-15.10-15.20.sql */
18-
1917
CREATE SCHEMA elispotlk;
2018
GO
21-
-- Until 21.11.5, the elispotassay module did not claim ownership of the "elispotantigen" schema. So, deleting that
22-
-- module and its schema would leave "elispotantigen" behind and any subsequent bootstrap would fail. See #44610.
23-
EXEC core.fn_dropIfExists '*', 'elispotantigen', 'SCHEMA';
24-
GO
2519
CREATE SCHEMA elispotantigen;
2620
GO
2721

@@ -54,33 +48,5 @@ CREATE TABLE elispotlk.rundata
5448

5549
CREATE INDEX idx_elispotrundata_runid ON elispotlk.rundata(RunId);
5650

57-
INSERT INTO elispotlk.rundata (RunId, Specimenlsid, SpotCount, WellgroupName, WellgroupLocation, NormalizedSpotCount, AntigenWellgroupName, ObjectUri, ObjectId)
58-
SELECT
59-
RunId,SpecimenLSID, SpotCount, WellGroupName, WellgroupLocation, NormalizedSpotCount,
60-
CASE WHEN AntigenWellgroupNameTemp IS NULL THEN AntigenName ELSE AntigenWellgroupNameTemp END AS AntigenWellgroupName,
61-
ObjectURI, ObjectId
62-
FROM (
63-
SELECT
64-
(SELECT RunId FROM exp.Data d, exp.Object parent WHERE d.LSID = parent.ObjectURI and parent.ObjectId = o.OwnerObjectId) AS RunId,
65-
66-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
67-
WHERE pd.PropertyURI LIKE '%:SpecimenLsid' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS SpecimenLSID,
68-
(SELECT FloatValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
69-
WHERE pd.PropertyURI LIKE '%:SpotCount' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS SpotCount,
70-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
71-
WHERE pd.PropertyURI LIKE '%:WellgroupName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS WellGroupName,
72-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
73-
WHERE pd.PropertyURI LIKE '%:WellgroupLocation' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS WellgroupLocation,
74-
(SELECT FloatValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
75-
WHERE pd.PropertyURI LIKE '%:NormalizedSpotCount' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS NormalizedSpotCount,
76-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
77-
WHERE pd.PropertyURI LIKE '%:AntigenWellgroupName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS AntigenWellgroupNameTemp,
78-
(SELECT StringValue FROM exp.ObjectProperty op, exp.PropertyDescriptor pd
79-
WHERE pd.PropertyURI LIKE '%:AntigenName' AND op.PropertyId = pd.PropertyId AND op.ObjectId = o.ObjectId) AS AntigenName,
80-
ObjectURI,
81-
ObjectId
82-
FROM exp.Object o WHERE ObjectURI LIKE '%ElispotAssayDataRow%') x
83-
WHERE specimenlsid IS NOT NULL AND RunID IS NOT NULL;
84-
8551
ALTER TABLE elispotlk.rundata ADD Cytokine NVARCHAR(4000);
86-
ALTER TABLE elispotlk.rundata ADD SpotSize REAL;
52+
ALTER TABLE elispotlk.rundata ADD SpotSize REAL;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2015-2018 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
-- Drop unused column
18+
ALTER TABLE elispotlk.rundata DROP COLUMN ObjectId;

elispotassay/resources/schemas/elispotlk.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<column columnName="Activity"/>
3838
<column columnName="Intensity"/>
3939
<column columnName="ObjectUri"/>
40-
<column columnName="ObjectId"/>
4140
</columns>
4241
</table>
4342
<table tableName="Antigen" tableDbType="NOT_IN_DB">

elispotassay/src/org/labkey/elispot/AbstractElispotDataHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ protected void importData(ExpRun run, DataIteratorBuilder dataRows) throws Exper
109109
String dataRowLsid = ElispotDataHandler.getDataRowLsid(runData.get(0).getLSID(), rowPos, colPos).toString();
110110

111111
Map<String, Object> runDataFields = new HashMap<>();
112-
runDataFields.put("ObjectId", 0);
113112
runDataFields.put("ObjectUri", dataRowLsid);
114113
runDataFields.put("RunId", run.getRowId());
115114
runDataFields.put(ELISPOT_INPUT_MATERIAL_DATA_PROPERTY, row.get(ELISPOT_INPUT_MATERIAL_DATA_PROPERTY));

elispotassay/src/org/labkey/elispot/ElispotModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public String getName()
4646
@Override
4747
public @Nullable Double getSchemaVersion()
4848
{
49-
return 25.000;
49+
return 25.001;
5050
}
5151

5252
@Override

elispotassay/src/org/labkey/elispot/RunDataRow.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class RunDataRow
3939
private Double _activity;
4040
private Double _intensity;
4141
private String _objectUri;
42-
private int _objectId; // TODO: remove when we remove use of exp.Object
4342

4443
private Map<String, Object> _antigenRow = null;
4544

@@ -194,16 +193,6 @@ public void setObjectUri(String objectUri)
194193
_objectUri = objectUri;
195194
}
196195

197-
public int getObjectId()
198-
{
199-
return _objectId;
200-
}
201-
202-
public void setObjectId(int objectId)
203-
{
204-
_objectId = objectId;
205-
}
206-
207196
public String getAntigenLsid()
208197
{
209198
return _antigenLsid;

elispotassay/src/org/labkey/elispot/query/ElispotRunAntigenTable.java

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,22 @@
1515
*/
1616
package org.labkey.elispot.query;
1717

18+
import org.labkey.api.assay.AssayProvider;
19+
import org.labkey.api.assay.AssaySchema;
1820
import org.labkey.api.data.ColumnInfo;
1921
import org.labkey.api.data.ContainerFilter;
2022
import org.labkey.api.data.JdbcType;
2123
import org.labkey.api.data.SQLFragment;
22-
import org.labkey.api.data.TableInfo;
2324
import org.labkey.api.exp.api.ExpProtocol;
2425
import org.labkey.api.exp.api.StorageProvisioner;
2526
import org.labkey.api.exp.property.Domain;
2627
import org.labkey.api.query.ExprColumn;
2728
import org.labkey.api.query.FieldKey;
28-
import org.labkey.api.query.LookupForeignKey;
29-
import org.labkey.api.assay.AbstractAssayProvider;
30-
import org.labkey.api.assay.AssayProvider;
31-
import org.labkey.api.assay.AssaySchema;
32-
import org.labkey.elispot.ElispotAssayProvider;
3329
import org.labkey.elispot.ElispotDataHandler;
3430

3531
import java.util.ArrayList;
3632
import java.util.List;
3733

38-
/**
39-
* User: klum
40-
* Date: Jan 27, 2011
41-
* Time: 1:45:11 PM
42-
*/
4334
public class ElispotRunAntigenTable extends PlateBasedAssayRunDataTable
4435
{
4536
public ElispotRunAntigenTable(final AssaySchema schema, ContainerFilter cf, final Domain domain, ExpProtocol protocol)
@@ -74,34 +65,6 @@ public List<FieldKey> getDefaultVisibleColumns()
7465
return fieldKeys;
7566
}
7667

77-
@Override
78-
protected ColumnInfo resolveColumn(String name)
79-
{
80-
ColumnInfo result = super.resolveColumn(name);
81-
82-
if ("Properties".equalsIgnoreCase(name))
83-
{
84-
// Hook up a column that joins back to this table so that the columns formerly under the Properties
85-
// node can still be queried there.
86-
var wrapped = wrapColumn("Properties", getRealTable().getColumn("ObjectId"));
87-
wrapped.setIsUnselectable(true);
88-
LookupForeignKey fk = new LookupForeignKey(getContainerFilter(), "ObjectId", null)
89-
{
90-
@Override
91-
public TableInfo getLookupTableInfo()
92-
{
93-
Domain domain = AbstractAssayProvider.getDomainByPrefix(_protocol, ElispotAssayProvider.ASSAY_DOMAIN_ANTIGEN_WELLGROUP, false);
94-
return new ElispotRunAntigenTable(_userSchema, getLookupContainerFilter(), domain, _protocol);
95-
}
96-
};
97-
fk.setPrefixColumnCaption(false);
98-
wrapped.setFk(fk);
99-
result = wrapped;
100-
}
101-
102-
return result;
103-
}
104-
10568
@Override
10669
protected void addPropertyColumns(final AssaySchema schema, final ExpProtocol protocol, final AssayProvider provider, List<FieldKey> visibleColumns)
10770
{

elispotassay/src/org/labkey/elispot/query/ElispotRunDataTable.java

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
package org.labkey.elispot.query;
1818

1919
import org.jetbrains.annotations.NotNull;
20+
import org.labkey.api.assay.AbstractAssayProvider;
21+
import org.labkey.api.assay.AssayProvider;
22+
import org.labkey.api.assay.AssaySchema;
23+
import org.labkey.api.assay.AssayService;
2024
import org.labkey.api.assay.plate.AbstractPlateBasedAssayProvider;
25+
import org.labkey.api.assay.plate.PlateReader;
2126
import org.labkey.api.data.ColumnInfo;
2227
import org.labkey.api.data.ContainerFilter;
2328
import org.labkey.api.data.DataColumn;
24-
import org.labkey.api.data.DisplayColumn;
25-
import org.labkey.api.data.DisplayColumnFactory;
2629
import org.labkey.api.data.RenderContext;
2730
import org.labkey.api.data.TableInfo;
2831
import org.labkey.api.exp.api.ExpProtocol;
@@ -31,12 +34,6 @@
3134
import org.labkey.api.exp.property.DomainProperty;
3235
import org.labkey.api.exp.query.ExpMaterialTable;
3336
import org.labkey.api.query.FieldKey;
34-
import org.labkey.api.query.LookupForeignKey;
35-
import org.labkey.api.assay.AbstractAssayProvider;
36-
import org.labkey.api.assay.AssayProvider;
37-
import org.labkey.api.assay.AssaySchema;
38-
import org.labkey.api.assay.AssayService;
39-
import org.labkey.api.assay.plate.PlateReader;
4037
import org.labkey.api.query.QueryForeignKey;
4138
import org.labkey.api.util.HtmlString;
4239
import org.labkey.elispot.ElispotAssayProvider;
@@ -47,10 +44,6 @@
4744
import java.util.ArrayList;
4845
import java.util.List;
4946

50-
/**
51-
* User: Karl Lum
52-
* Date: Jan 21, 2008
53-
*/
5447
public class ElispotRunDataTable extends PlateBasedAssayRunDataTable
5548
{
5649
public ElispotRunDataTable(final AssaySchema schema, ContainerFilter cf, final ExpProtocol protocol)
@@ -111,33 +104,6 @@ protected void addPropertyColumns(final AssaySchema schema, final ExpProtocol pr
111104
antigenLsidColumn.setFk(QueryForeignKey.from(getUserSchema(), getContainerFilter()).to(ElispotProtocolSchema.ANTIGEN_TABLE_NAME, "AntigenLsid", null));
112105
}
113106

114-
@Override
115-
protected ColumnInfo resolveColumn(String name)
116-
{
117-
ColumnInfo result = super.resolveColumn(name);
118-
119-
if ("Properties".equalsIgnoreCase(name))
120-
{
121-
// Hook up a column that joins back to this table so that the columns formerly under the Properties
122-
// node can still be queried there.
123-
var wrapped = wrapColumn("Properties", getRealTable().getColumn("ObjectId"));
124-
wrapped.setIsUnselectable(true);
125-
LookupForeignKey fk = new LookupForeignKey(getContainerFilter(), "ObjectId", null)
126-
{
127-
@Override
128-
public TableInfo getLookupTableInfo()
129-
{
130-
return new ElispotRunDataTable(_userSchema, getLookupContainerFilter(), _protocol);
131-
}
132-
};
133-
fk.setPrefixColumnCaption(false);
134-
wrapped.setFk(fk);
135-
result = wrapped;
136-
}
137-
138-
return result;
139-
}
140-
141107
@Override
142108
public List<FieldKey> getDefaultVisibleColumns()
143109
{

0 commit comments

Comments
 (0)