From f9c8db5a4baae3f18b2679ad39fd95d28e64a4c9 Mon Sep 17 00:00:00 2001 From: Lawrence Babb Date: Mon, 7 Oct 2024 13:03:25 -0400 Subject: [PATCH] added cvc-proj-stdate function. --- scripts/general/cvc-project-start-date-func.sql | 4 ++++ scripts/tracker-procs/02-variation-track-proc.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 scripts/general/cvc-project-start-date-func.sql diff --git a/scripts/general/cvc-project-start-date-func.sql b/scripts/general/cvc-project-start-date-func.sql new file mode 100644 index 0000000..c731ba0 --- /dev/null +++ b/scripts/general/cvc-project-start-date-func.sql @@ -0,0 +1,4 @@ +CREATE OR REPLACE FUNCTION `clinvar_ingest.cvc_project_start_date`() +RETURNS DATE AS ( + "2023-01-07" +); \ No newline at end of file diff --git a/scripts/tracker-procs/02-variation-track-proc.sql b/scripts/tracker-procs/02-variation-track-proc.sql index 8127c22..14a6d79 100644 --- a/scripts/tracker-procs/02-variation-track-proc.sql +++ b/scripts/tracker-procs/02-variation-track-proc.sql @@ -31,7 +31,7 @@ BEGIN from `clinvar_ingest.report_variation` rv join `clinvar_ingest.voi_group` vg on vg.variation_id = rv.variation_id - join `clinvar_ingest.clinvar_project_releases` cv on + join `clinvar_ingest.all_schemas`() cv on cv.release_date between vg.start_release_date and vg.end_release_date where rv.report_id = "%s" """, rec.tname, rec.id);