From 9531756672ec17ab3930f1c2053f2c03826f15f4 Mon Sep 17 00:00:00 2001 From: Maria Lorena Rodriguez Viruel Date: Fri, 20 Oct 2023 17:30:59 -0300 Subject: [PATCH] Reverse change --- models/contact_views/contact_views.yml | 129 ++----------------------- 1 file changed, 6 insertions(+), 123 deletions(-) diff --git a/models/contact_views/contact_views.yml b/models/contact_views/contact_views.yml index e6d76556..65546438 100644 --- a/models/contact_views/contact_views.yml +++ b/models/contact_views/contact_views.yml @@ -1,143 +1,26 @@ version: 2 models: - - name: contactview_person + - name: raw_contacts columns: - - name: uuid - tests: - - not_null - - unique - - relationships: - to: ref('couchdb') - field: doc ->> '_id' - - name: name - tests: - - not_null - - name: patient_id - tests: - - not_null - - name: contactview_person_fields - columns: - - name: uuid + - name: doc tests: - not_null - - unique - - relationships: - to: ref('contactview_metadata') - field: uuid tests: - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') - - name: contactview_chw + compare_model: ref('couchdb') + - name: contactview_metadata columns: - name: uuid tests: - not_null - unique - - relationships: - to: ref('contactview_person_fields') - field: uuid - tests: - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_person_fields') - - name: contactview_chp - columns: - - name: uuid - tests: - - not_null - - unique - - relationships: - to: ref('contactview_chw') - field: uuid - - name: branch_uuid - tests: - - not_null - - name: supervisor_uuid - tests: - - not_null - tests: - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_person_fields') - - name: contactview_muted - columns: - - name: contact_uuid - tests: - - not_null - - unique - - relationships: - to: ref('contactview_metadata') - field: uuid - name: type tests: - not_null - accepted_values: values: [contact, clinic, district_hospital, health_center, person] - - name: mute_status - tests: - - not_null - - name: date - tests: - - not_null - tests: - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') - - name: contactview_hospital - columns: - - name: uuid - tests: - - not_null - - unique - - relationships: - to: ref('contactview_metadata') - field: uuid tests: - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') - - name: contactview_hierarchy - columns: - - name: branch_uuid - tests: - - not_null - - relationships: - to: ref('contactview_branch') - field: uuid - - name: chw_uuid - tests: - - not_null - - relationships: - to: ref('contactview_chp') - field: uuid - - name: chw_area_uuid - tests: - - not_null - - name: contactview_branch - columns: - - name: uuid - tests: - - not_null - - unique - - relationships: - to: ref('contactview_hospital') - field: uuid - - name: contactview_clinic - columns: - - name: uuid - tests: - - not_null - - relationships: - to: ref('contactview_metadata') - field: uuid - - name: chw_uuid - tests: - - not_null - - relationships: - to: ref('contactview_chw') - field: uuid - tests: - - dbt_utils.fewer_rows_than: - compare_model: ref('contactview_metadata') + - dbt_utils.equal_rowcount: + compare_model: ref('raw_contacts')