cli icon indicating copy to clipboard operation
cli copied to clipboard

Schema configuration in DBAB causes recreate everytime

Open hrfmartins opened this issue 5 months ago • 1 comments

Describe the issue

When defining a schema in an asset bundle, the schema gets recreated everytime. I poked around a little bit and firstly I found: force_destroy: true in bundle.tf.json.

Then I looked a bit at the source code, and I noticed this: https://github.com/databricks/cli/blob/4550b4993dd15b5ccae0a0359133c39b919b6b57/bundle/deploy/terraform/tfdyn/convert_schema.go#L23

This will make it so the schema gets recreated every time. This is might be problematic if there are other resources depending on the same schema, especially if they're of type MANAGED and not EXTERNAL.

Configuration

resources:
  schemas:
    configs:
      name: demo_schema
      catalog_name: demo_catalog
      comment: This schema was created by Databricks Asset Bundles and it represents a demo placeholder.
      storage_root: ...

Steps to reproduce the behavior

  1. Use the configuration defined
  2. Run databricks bundle deploy ... for the first time
  3. Run databricks bundle deploy ...for the second time,
  4. See error:
The following UC schemas will be deleted or recreated. Any underlying data may be lost:
  recreate schema demo_schema

hrfmartins avatar Aug 29 '25 09:08 hrfmartins

+1, I also have this issue.

msaad02 avatar Sep 04 '25 18:09 msaad02

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Nov 26 '25 00:11 github-actions[bot]