From 7af816ea012f10d445622eba1701ee9066cd01d6 Mon Sep 17 00:00:00 2001 From: Gregory Dubois-Felsmann Date: Wed, 8 Nov 2023 11:10:09 -0800 Subject: [PATCH] Add all intra-DP0.2 single-attribute foreign keys --- yml/dp02_dc2.yaml | 74 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/yml/dp02_dc2.yaml b/yml/dp02_dc2.yaml index a0e7bd2d..1bdd94b5 100644 --- a/yml/dp02_dc2.yaml +++ b/yml/dp02_dc2.yaml @@ -7241,6 +7241,7 @@ tables: datatype: long mysql:datatype: BIGINT description: Unique id. + ivoa:ucd: meta.id;meta.main - name: gPSFluxChi2 "@id": "#DiaObject.gPSFluxChi2" datatype: double @@ -7964,6 +7965,7 @@ tables: mysql:datatype: BIGINT description: Unique ID of CCD and visit where this source was detected and measured. Primary Key of the CcdVisit Table. fits:tunit: + ivoa:ucd: meta.id;obs.image - name: centroid_flag "@id": "#DiaSource.centroid_flag" datatype: boolean @@ -8009,12 +8011,14 @@ tables: mysql:datatype: BIGINT description: Unique DiaObject ID. Primary Key of the DIA Object Table fits:tunit: + ivoa:ucd: meta.id;src - name: diaSourceId "@id": "#DiaSource.diaSourceId" datatype: long mysql:datatype: BIGINT description: Unique ID fits:tunit: + ivoa:ucd: meta.id;meta.main;src - name: dipAngle "@id": "#DiaSource.dipAngle" datatype: double @@ -8334,6 +8338,23 @@ tables: mysql:datatype: FLOAT description: 1-sigma uncertainty on y position fits:tunit: pixel + constraints: + - name: DiaO_DiaS + "@type": "ForeignKey" + "@id": "#FK_DiaSource_diaObjectId_DiaObject_diaObjectId" + description: Link DiaObjects to associated DiaSources + columns: + - "#DiaSource.diaObjectId" + referencedColumns: + - "#DiaObject.diaObjectId" + - name: CcdV_DiaS + "@type": "ForeignKey" + "@id": "#FK_DiaSource_ccdVisitId_CcdVisit_ccdVisitId" + description: Link CCD-level images to associated DiaSources + columns: + - "#DiaSource.ccdVisitId" + referencedColumns: + - "#CcdVisit.ccdVisitId" - name: ForcedSourceOnDiaObject "@id": "#ForcedSourceOnDiaObject" description: "Point-source forced-photometry measurements on individual single-epoch @@ -8385,7 +8406,7 @@ tables: mysql:datatype: BIGINT description: Unique DiaObject ID. Primary Key of the DiaObject Table fits:tunit: - ivoa:ucd: meta.id + ivoa:ucd: meta.id;src tap:principal: 1 tap:column_index: 10 - name: forcedSourceOnDiaObjectId @@ -8394,7 +8415,7 @@ tables: mysql:datatype: BIGINT description: Unique ID of forced source. Primary Key. fits:tunit: - ivoa:ucd: meta.id;meta.main + ivoa:ucd: meta.id;meta.main;src tap:principal: 1 tap:column_index: 100 - name: localBackground_instFlux @@ -8667,6 +8688,23 @@ tables: ivoa:ucd: meta.id tap:principal: 0 tap:column_index: 140 + constraints: + - name: DiaO_DiaFS + "@type": "ForeignKey" + "@id": "#FK_ForcedSourceOnDiaObject_diaObjectId_DiaObject_diaObjectId" + description: Link DiaObjects to associated DiaForcedSources + columns: + - "#ForcedSourceOnDiaObject.diaObjectId" + referencedColumns: + - "#DiaObject.diaObjectId" + - name: CcdV_DiaS + "@type": "ForeignKey" + "@id": "#FK_ForcedSourceOnDiaObject_ccdVisitId_CcdVisit_ccdVisitId" + description: Link CCD-level images to associated DiaForcedSources + columns: + - "#ForcedSourceOnDiaObject.ccdVisitId" + referencedColumns: + - "#CcdVisit.ccdVisitId" - name: Visit '@id': '#Visit' description: "Metadata about the pointings of the DC2 simulated survey, @@ -8678,7 +8716,7 @@ tables: datatype: long description: Unique identifier. mysql:datatype: INTEGER - ivoa:ucd: meta.id;obs.image + ivoa:ucd: meta.id;meta.main;obs.image - name: physical_filter '@id': '#Visit.physical_filter' datatype: char @@ -8784,11 +8822,13 @@ tables: datatype: long description: Primary key (unique identifier). mysql:datatype: BIGINT + ivoa:ucd: meta.id;meta.main;obs.image - name: visitId '@id': '#CcdVisit.visitId' datatype: long description: Reference to the corresponding entry in the Visit table. mysql:datatype: INTEGER + ivoa:ucd: meta.id;obs.image - name: physical_filter '@id': '#CcdVisit.physical_filter' datatype: char @@ -8970,6 +9010,15 @@ tables: mysql:datatype: DOUBLE fits:tunit: deg ivoa:ucd: pos.eq.dec + constraints: + - name: Visit_CcdV + "@type": "ForeignKey" + "@id": "#FK_CcdVisit_visitId_Visit_visitId" + description: Link DiaObjects to associated DiaSources + columns: + - "#DiaSource.diaObjectId" + referencedColumns: + - "#DiaObject.diaObjectId" - name: CoaddPatches "@id": "#coaddpatches" description: "Static information about the subset of tracts and patches from the standard @@ -9088,6 +9137,23 @@ tables: tap:column_index: 2 tap:principal: 1 description: Combination of TruthSummary id and truth_type fields, used for JOINs. + constraints: + - name: Obj_MatTru + "@type": "ForeignKey" + "@id": "#FK_MatchesTruth_match_objectId_Object_objectId" + description: Link Object to potential matches to Truth entries + columns: + - "#MatchesTruth.match_objectId" + referencedColumns: + - "#Object.objectId" + - name: Tru_MatTru + "@type": "ForeignKey" + "@id": "#FK_MatchesTruth_id_truth_type_TruthSummary_id_truth_type" + description: Link Truth entries to potential matches to Objects + columns: + - "#MatchesTruth.id_truth_type" + referencedColumns: + - "#TruthSummary.id_truth_type" # - name: MatchesObject # '@id': '#MatchesObject' # description: Match information for objectTable_tract sources @@ -9128,6 +9194,7 @@ tables: datatype: char mysql:datatype: CHAR(22) description: Combination of id and truth_type fields, used for JOINs with MatchesTruth. + ivoa:ucd: meta.id - name: id '@id': '#TruthSummary.id' datatype: char @@ -9136,6 +9203,7 @@ tables: tap:column_index: 1 tap:principal: 1 description: Unique object ID + ivoa:ucd: meta.id;meta.main - name: host_galaxy '@id': '#TruthSummary.host_galaxy' datatype: long