optimism-models/macros/tests/tx_block_count.sql
drethereum c8c78bf62d
AN-2581/unique-key-tx-test (#60)
* changed unique keys on logs and traces and added new test to logs

* added dbt-env to gitignore for SSO functionality
2023-01-03 14:07:13 -07:00

14 lines
228 B
SQL

{% test tx_block_count(
model,
column_name
) %}
SELECT
{{ column_name }},
COUNT(DISTINCT block_number) AS num_blocks
FROM
{{ model }}
GROUP BY {{ column_name }}
HAVING num_blocks > 1
{% endtest %}