Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cascade to drop mv #904

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Add cascade to drop mv #904

merged 2 commits into from
Sep 6, 2024

Conversation

mikealfare
Copy link
Contributor

resolves #642

Problem

We drop materialized views with a standard DROP instead of a DROP ... CASCADE. When a dbt project has materialized views that reference other materialized views, the materialized view cannot be dropped during a full refresh. This raises a database error.

Solution

Update the DROP statement to a DROP ... CASCADE statement.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare self-assigned this Sep 6, 2024
@mikealfare mikealfare requested a review from a team as a code owner September 6, 2024 14:29
@cla-bot cla-bot bot added the cla:yes label Sep 6, 2024
@mikealfare mikealfare merged commit d189acb into main Sep 6, 2024
36 checks passed
@mikealfare mikealfare deleted the add-cascade-to-drop-mv branch September 6, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants