What is ParentTableNum in SpAuditLog referencing?

There are clearly references to table ID:s, but where are these ID:s defined?

Hi @chrisGNM

The table IDs are defined in xml files in the Specify 6 repository.
From the root of the repository in any Specify 6 installation, you can find the table ids in config/specify_tableid_listing.xml

If you do not have quick access to a local installation of Specify 6, you can view this file on GitHub in the Specify 6 repository: specify6/config/specify_tableid_listing.xml at master · specify/specify6 · GitHub

Here is an example table defined In the specify_tableid_listing.xml. We know by the name attribute that this is the table information for the Accession table.
It’s id is listed as a separate attribute; in this case its id is 7.

<table name="edu.ku.brc.specify.datamodel.Accession" abbrev="ac" id="7" workbench="true" searchable="true">
        <display view="Accession" dataobjformatter="" uiformatter="AccessionNumber" searchdlg="AccessionSearch" newobjdlg="AccessionDisplay"/>
        <businessrule>edu.ku.brc.specify.datamodel.busrules.AccessionBusRules</businessrule>        
 </table>

Alternatively, you can also find the table ids in config/specify_datamodel.xml.
(This file can not be found in the Specify 6 repository because it is generated by Specify when it is run).

1 Like

No need to go into specify 6. You can see table IDs in Specify 7 too.
Simply open the Datamodel Viewer in your local installation, or use the one on the demo instance - https://sp7demofish.specifycloud.org/specify/data-model/ and see the “Table Id” column

The SpAudidLog table includes both TableId and ParentTableId. Often you would see only TableId set. The case when both is set is for example if you edited a Determination. In that case Determination table id would be stored in TableId column and Collection Object table id will be stored in the ParentTableId column

1 Like

Nice! Thanks.