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 force_destroy flag to databricks_schema & databricks_catalog #1578

Merged
merged 3 commits into from
Sep 2, 2022

Conversation

nkvuong
Copy link
Contributor

@nkvuong nkvuong commented Sep 2, 2022

Add force_destroy flag to UC schema & catalog. This achieves the same functionality as the purge flag in the cli, which loop through all child schemas & tables and delete them before delete the parent securable

Closes #1576

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2022

Codecov Report

Merging #1578 (01ea46e) into master (a723577) will decrease coverage by 0.01%.
The diff coverage is 86.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1578      +/-   ##
==========================================
- Coverage   90.15%   90.14%   -0.02%     
==========================================
  Files         132      132              
  Lines       10629    10655      +26     
==========================================
+ Hits         9583     9605      +22     
- Misses        667      669       +2     
- Partials      379      381       +2     
Impacted Files Coverage Δ
catalog/resource_schema.go 95.34% <84.61%> (-4.66%) ⬇️
catalog/resource_catalog.go 95.45% <88.23%> (-4.55%) ⬇️

func (a CatalogsAPI) deleteCatalog(name string) error {
// TODO: force_destroy attribute
return a.client.Delete(a.context, "/unity-catalog/catalogs/"+name+"?force=true", nil)
func (a CatalogsAPI) deleteCatalog(name string, force bool) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkvuong can you create a separate method and call it forceDelete? this will align with future SDK migration

@nkvuong nkvuong changed the title add force_destroy flag to schema & catalog add force_destroy flag to schema & catalog Sep 2, 2022
@nkvuong nkvuong changed the title add force_destroy flag to schema & catalog add force_destroy flag to databricks_schema & databricks_catalog Sep 2, 2022
@nfx nfx merged commit f60f257 into master Sep 2, 2022
@nfx nfx deleted the feature/add-uc-force-destroy branch September 2, 2022 12:04
@nfx nfx mentioned this pull request Sep 12, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Provide purge flag for databricks_schema
3 participants