From a7731344505a6ed60949e004210b88cd5bd96644 Mon Sep 17 00:00:00 2001 From: Jeremy McCormick Date: Fri, 20 Oct 2023 13:50:34 -0500 Subject: [PATCH 1/2] Add FK constraint from ForcedSource to Object in dp02_dc2 schema This demonstrates working foreign key constraints in felis that are loaded into the TAP_SCHEMA table. --- yml/dp02_dc2.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yml/dp02_dc2.yaml b/yml/dp02_dc2.yaml index c242edb7..2f31ccc4 100644 --- a/yml/dp02_dc2.yaml +++ b/yml/dp02_dc2.yaml @@ -7213,6 +7213,15 @@ tables: ivoa:ucd: phot.flux tap:principal: 1 tap:column_index: 30 + constraints: + - name: FK_forcedSourceId_objectId + "@type": "ForeignKey" + "@id": "#FK_forcedSourceId_objectId" + description: Foreign key from ForcedSource to Object + columns: + - "#ForcedSource.forcedSourceId" + referencedColumns: + - "#Object.objectId" - name: DiaObject "@id": "#DiaObject" description: "Properties of time-varying astronomical objects based on association From a6db091e51c48724de1249546507d4c1cd39f0c6 Mon Sep 17 00:00:00 2001 From: gpdf Date: Mon, 23 Oct 2023 13:43:55 -0700 Subject: [PATCH 2/2] Correct error in Obj_FS constraint and rename --- yml/dp02_dc2.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yml/dp02_dc2.yaml b/yml/dp02_dc2.yaml index 2f31ccc4..6aec6422 100644 --- a/yml/dp02_dc2.yaml +++ b/yml/dp02_dc2.yaml @@ -7214,12 +7214,12 @@ tables: tap:principal: 1 tap:column_index: 30 constraints: - - name: FK_forcedSourceId_objectId + - name: Obj_FS "@type": "ForeignKey" - "@id": "#FK_forcedSourceId_objectId" - description: Foreign key from ForcedSource to Object + "@id": "#FK_ForcedSource_objectId_Object_objectId" + description: Link Objects to associated ForcedSources columns: - - "#ForcedSource.forcedSourceId" + - "#ForcedSource.objectId" referencedColumns: - "#Object.objectId" - name: DiaObject