dbt Constraints v0.3.2
New Features
- On PostgreSQL, the package will now drop PK/UK/FK on tables before truncating them to avoid errors with seeds. The package declares a truncate_relation() macro that does the drops before calling the dbt core truncate_relation() macro.
Fixes
- On PostgreSQL, adds a commit after each
ALTER
since DDL is transactional - Modified the SQL for the
foreign_key
test to use aLEFT JOIN
instead of anIN (SELECT
subquery. The SQL is logically identical and Snowflake's query optimizer was already rewriting the subquery behind the scenes. However, on PostgreSQL the subquery SQL has much worse performance compared to the join SQL. Apparently dbt-Labs made the same change themselves in theirrelationship
test. Now the SQL is very similar to the latestrelationship
test's SQL but supports compound keys whereasrelationship
only supports one column.
Known issues
None
Full Changelog: 0.3.1...0.3.2