Skip to content

Commit

Permalink
Change the way columns are referenced in couchdb
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed Oct 20, 2023
1 parent 349016c commit 0e61edf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/brac/useviews/useview_postnatal_care.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

SELECT
"@timestamp"::timestamp without time zone AS "@timestamp",
doc ->> '_id'::text AS uuid,
(couchdb.doc ->> '_id') as uuid,
doc ->> 'form'::text AS form,
doc #>> '{contact,_id}'::text[] AS chw,
(couchdb.doc #>> '{contact,_id}') as chw,
doc #>> '{contact,_id}'::text[] AS reported_by,
doc #>> '{contact,parent,_id}'::text[] AS reported_by_parent,
COALESCE(doc #>> '{fields,inputs,meta,location,lat}'::text[], ''::text) AS latitude,
Expand Down Expand Up @@ -68,4 +68,4 @@
doc ->> 'form' = 'postnatal_care'::text
{% if is_incremental() %}
AND "@timestamp" > {{ max_existing_timestamp('"@timestamp"') }}
{% endif %}
{% endif %}

0 comments on commit 0e61edf

Please sign in to comment.