diff --git a/models/root/document_metadata.sql b/models/root/document_metadata.sql index 4343bd67..231e11c1 100644 --- a/models/root/document_metadata.sql +++ b/models/root/document_metadata.sql @@ -1,5 +1,3 @@ -{% set import_couchdb_data = select_table("{{ env_var('POSTGRES_SCHEMA') }}.{{ env_var('POSTGRES_TABLE') }}", ref('test_source_table')) %} - {{ config( materialized = 'incremental', @@ -20,7 +18,7 @@ SELECT _deleted, saved_timestamp, doc->>'type' as doc_type -FROM {{ import_couchdb_data }} +FROM {{ env_var('POSTGRES_SCHEMA') }}.{{ env_var('POSTGRES_TABLE') }} source_table {% if is_incremental() %} WHERE source_table.saved_timestamp >= {{ max_existing_timestamp('saved_timestamp') }} {% endif %}