diff --git a/CHANGELOG.md b/CHANGELOG.md index 88efbe6b..f7ddf1b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# dbt-utils v0.6.6 + +## Fixes + +- make `sequential_values` schema test use `dbt_utils.type_timestamp()` to allow for compatibility with db's without timestamp data type. [#376](https://github.com/fishtown-analytics/dbt-utils/pull/376) from [@swanderz](https://github.com/swanderz) # dbt-utils v0.6.5 ## Features * Add new `accepted_range` test ([#276](https://github.com/fishtown-analytics/dbt-utils/pull/276) [@joellabes](https://github.com/joellabes)) diff --git a/macros/schema_tests/sequential_values.sql b/macros/schema_tests/sequential_values.sql index 07d3ee7a..0af87ff3 100644 --- a/macros/schema_tests/sequential_values.sql +++ b/macros/schema_tests/sequential_values.sql @@ -21,7 +21,7 @@ validation_errors as ( * from windowed {% if datepart %} - where not(cast({{ column_name }} as timestamp)= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as timestamp)) + where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }})) {% else %} where not({{ column_name }} = previous_{{ column_name }} + {{ interval }}) {% endif %}