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

Automate cleaning up the removed or renamed models #531

Open
rachellougee opened this issue Jan 20, 2023 · 2 comments
Open

Automate cleaning up the removed or renamed models #531

rachellougee opened this issue Jan 20, 2023 · 2 comments
Labels
product:data-platform Issues related to the Data Platform product

Comments

@rachellougee
Copy link
Contributor

rachellougee commented Jan 20, 2023

User Story

When a model is deleted or renamed from code, dbt clean doesn't automatically remove the old models from QA and Production schema so we have to manually delete it. Tobias shared https://discourse.getdbt.com/t/faq-cleaning-up-removed-models-from-your-production-schema/113/11 that we might consider writing a macro to handle the deleted models
automatically

@rachellougee rachellougee changed the title Cleaning up removed models from qa and production schema Automate cleaning up the removed models from qa and production schema Jan 20, 2023
@rachellougee rachellougee self-assigned this Jan 25, 2023
@rachellougee rachellougee changed the title Automate cleaning up the removed models from qa and production schema Automate cleaning up the removed or renamed models Jan 25, 2023
@rachellougee
Copy link
Contributor Author

https://docs.getdbt.com/faqs/models/removing-deleted-models
In dbt doc, it seems to suggest manually delete

When you remove models from your dbt project, you should manually drop the related relations from your schema.`

@rachellougee
Copy link
Contributor Author

rachellougee commented Jan 27, 2023

Looked at this a little bit, the proposed solutions to write a macro in this post are convoluted and require proper permission to run dbt run-operation delete_outdated_tables --args "{schema: [SCHEMA]}" command on production and qa to invoke the macro.

Since dbt suggests manually dropping the related staled model it in their doc, I will leave it the way it is. If we end up having a lot of renamed models, we can revisit it

@blarghmatey blarghmatey added the product:data-platform Issues related to the Data Platform product label Mar 21, 2023
@rachellougee rachellougee removed their assignment May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product:data-platform Issues related to the Data Platform product
Projects
None yet
Development

No branches or pull requests

2 participants