Hard table with foreign key to assay run

LabKey Support Forum (Inactive)
Hard table with foreign key to assay run Will Holtz  2016-03-08 16:20
Status: Closed
 
Hi -- I am trying to create a hard table that has an FK to an assay run. In the .sql file that creates the table, I have a FK to exp.experimentrun. In the xml file that defines the table metadata I have the following:

<?xml version="1.0" encoding="UTF-8"?>

<ns:tables xsi:schemaLocation="http://labkey.org/data/xml ..\..\..\..\..\schemas\tableInfo.xsd" xmlns:ns="http://labkey.org/data/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns:table tableName="Plate" tableDbType="TABLE">
        <ns:columns>
            <ns:column columnName="OD">
                <ns:fk>
                    <ns:fkFolderPath>/home/OD</ns:fkFolderPath>
                    <ns:fkColumnName>RowId</ns:fkColumnName>
                    <ns:fkDbSchema>assay.OD.OD</ns:fkDbSchema>
                    <ns:fkTable>Runs</ns:fkTable>
                </ns:fk>
            </ns:column>
        </ns:columns>
    </ns:table>
</ns:tables>

When I view the metadata for this table via the Labkey Schema Browser, it does not show anything under lookup column for this row. Anyone know what I'm missing or if there is a better way of creating the lookup?

thanks,
-Will
 
 
Will Holtz responded:  2016-03-08 16:53
I got it to work, but I don't understand it.

In my first post, that metadata was in resources/schemas/SCHEMANAME.xml. Moving the metadata to resources/queries/SCHEMANAME/TABLENAME.query.xml fixed the problem.

-Will
 
jeckels responded:  2016-03-08 18:47
Hi Will,

resources/schemas/SCHEMANAME.xml points at tables in the "real" underlying database.

resources/queries/SCHEMANAME/TABLENAME.query.xml points at tables in the schema/queries that are exposed through the schema browser.

They often line up identically, but in the case of the assay runs tables, the real database table is exp.experimentrun, while the assay schema exposes a filtered view for a specific assay design under the assay.ASSAY_TYPE.ASSAY_DESIGN schema.

Thanks,
Josh
 
Will Holtz responded:  2016-03-08 19:51
Good to know -- thanks Josh!

-Will