Skip to content

Support schema rename and improve catalog rename - #7343

Open
denik wants to merge 21 commits into
mainfrom
denik/schemas-remove
Open

denik wants to merge 21 commits into
mainfrom
denik/schemas-remove

Conversation

@denik

@denik denik commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Changing a schema's name now renames it in place (PATCH new_name) instead of deleting and recreating it, so the schema and its contents survive.

UC moves the children of a renamed catalog or schema along with it. A volume in a renamed schema, or a schema in a renamed catalog (schema_name/catalog_name: ${resources.<parent>.name}), used to be planned as a recreate. Its create then failed with RESOURCE_ALREADY_EXISTS on every deploy, because the recreate had already dropped it from state. The planner now re-keys such children (update_id, reason parent_renamed) under their new parents, with no request when the parent's rename is their only change. Catalog rename was already supported and had the same latent bug for child schemas.

A resource can also be missing from its recorded ID with no rename in the plan: a deploy stopped after renaming the parent, or the resource or its parent was renamed out of band. When the read at the recorded ID finds nothing, the plan now reads at the ID the config gives the resource. It takes what it finds only if its stable ID matches the one now saved in the state entry (schema_id, volume_id). A different object under that name is planned as a create, which UC rejects, so it is never adopted. Catalogs have no stable ID and are not looked for yet.

The test server now moves children on catalog/schema rename, deletes them with a forced catalog/schema delete, and rejects a catalog create under a taken name, like UC does.

With #7345 and #7361 (merged), which re-key grants and permissions when their parent's ID changes, a renamed schema keeps those in sync too. Registered models and UC secrets follow parent renames in #7379 and #7381.

Tests

  • New acceptance tests, Cloud = true, passing locally and on AWS, GCP and Azure: schemas/rename, schemas/rename_with_volume, catalogs/rename (catalog → schema → volume).
  • New schemas/rename_then_change: after a parent rename, a volume update, rename and recreate all reach its new path, also after a second rename and a rename back.
  • New schemas/rename_with_volume_ref: a job reading the volume's full_name and id gets the new values.
  • New schemas/rename_interrupted (local only; uses the test server's kill hook): the CLI is killed after the schema's rename is saved and before the volume's update. The next deploy updates the volume at its new path, keeping its volume_id. Without the fix it planned a create.
  • New schemas/recreate_interrupted (local only): the same kill during a recreate of the schema under a new name. The volume went with the old schema, so the next deploy creates a new one.
  • New out-of-band renames, Cloud = true, config renamed to match: volumes/rename_out_of_band and schemas/rename_out_of_band (found by volume_id/schema_id, deploy sends no requests); catalogs/rename_out_of_band and catalogs/rename_all_out_of_band (schema and volume found; the catalog's create fails with CATALOG_ALREADY_EXISTS).
  • New out-of-band recreates, Cloud = true: volumes/recreate_out_of_band and schemas/recreate_out_of_band. An object is found under the new name but its id differs, so the plan creates instead of adopting it.
  • grants/schemas/change_name (from Re-key grants when their parent's ID changes #7345) now shows the in-place rename.
  • Updated migrate/auto/schema-rename (the migration now renames) and lifecycle/prevent-destroy (recreate lever switched from name to catalog_name).
  • Unit tests for followParentRenames, Changes.OnlyParentRenamed and the stable_id round trip through the state file and DMS.

This pull request and its description were written by Isaac.

@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 6bdb8f0e0 | Workflow run

Regression test report

Selected 20 changed tests (limit=20, 11 not selected)

32 tests: regression=24 unreleased=0 coverage=8 failing=0
test branch main (663e1f7) latest (v1.24.0)
TestAccept/bundle/lifecycle/prevent-destroy/DMS= ✅ ✅ ✅
TestAccept/bundle/lifecycle/prevent-destroy/DMS=true ✅ ✅ ✅
TestAccept/bundle/migrate/auto/registered-model-catalog-change/DMS= ✅ ✅ ✅
TestAccept/bundle/migrate/auto/schema-catalog-change/DMS= ✅ ✅ ✅
TestAccept/bundle/migrate/auto/schema-rename/DMS= ✅ ❌ ❌
TestAccept/bundle/migrate/auto/schema-storage-change/DMS= ✅ ✅ ✅
TestAccept/bundle/migrate/auto/volume-rename/DMS= ✅ ✅ ✅
TestAccept/bundle/migrate/auto/volume-type-change/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/catalogs/rename/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename_all_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename_all_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/catalogs/rename_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/recreate_interrupted/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/schemas/recreate_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/recreate_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_interrupted/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_then_change/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_then_change/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_volume/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_volume/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_volume_ref/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/schemas/rename_with_volume_ref/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/volumes/recreate_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/volumes/recreate_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/resources/volumes/rename_out_of_band/DMS= ✅ ❌ ❌
TestAccept/bundle/resources/volumes/rename_out_of_band/DMS=true ✅ ❌ ❌
TestAccept/bundle/migrate/auto/schema-rename/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/migrate/auto/schema-rename/output.txt
        +++ /tmp/TestAcceptbundlemigrateautoschema-renameDMS=1014625524/002/output.txt
        @@ -4,32 +4,23 @@
         
         === Rename the schema (an updatable id field) and deploy on direct
         >>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle deploy
        -Warn: migration to direct: schemas.my_schema: name differs between config ("myschema-[UNIQUE_NAME]-renamed") and terraform state ("myschema-[UNIQUE_NAME]"); this resource will be renamed.
        +Warn: migration to direct: schemas.my_schema: name differs between config ("myschema-[UNIQUE_NAME]-renamed") and terraform state ("myschema-[UNIQUE_NAME]"); this resource will be recreated.
         Notice: migrating your bundle to direct deployment engine (https://github.com/databricks/cli/issues/6765).
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Migrated 1 resource to direct deployment engine.
        -Updated schemas.my_schema
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
         
        -=== Redeploy on direct: the schema now matches config, so the plan is a clean no-op
        ->>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 1 unchanged
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.my_schema
        +Warn: Migration not committed, keeping Terraform state
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        -=== The schema exists under the new name and the local state is direct
        ->>> [CLI] schemas get main.myschema-[UNIQUE_NAME]-renamed
        -{
        -  "full_name": "main.myschema-[UNIQUE_NAME]-renamed"
        -}
        +Files: 2 uploaded, 0 deleted
         
        ->>> find.py \.databricks/.*(\.tfstate|resources.*\.json|\.wal)
        -.databricks/bundle/default/resources.json
        -.databricks/bundle/default/terraform/terraform.tfstate.backup
        -
         === Cleanup
         >>> [CLI] bundle destroy --auto-approve
        +Warn: migration to direct: schemas.my_schema: name differs between config ("myschema-[UNIQUE_NAME]-renamed") and terraform state ("myschema-[UNIQUE_NAME]"); this resource will be recreated.
        +Notice: migrating your bundle to direct deployment engine (https://github.com/databricks/cli/issues/6765).
         The following resources will be deleted:
           delete resources.schemas.my_schema
         
        @@ -38,4 +22,7 @@
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]
         
        +Migrated 1 resource to direct deployment engine.
         Destroy: 1 deleted
        +
        +Exit code: 1

latest (v1.24.0): same output as main (663e1f7)

TestAccept/bundle/resources/catalogs/rename/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=3084258270/002/output.txt
        @@ -73,7 +73,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -92,8 +92,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -111,7 +111,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -133,8 +133,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -146,65 +146,21 @@
         === Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Updated schemas.schema1
        -Updated volumes.volume1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 3 changed, 0 deleted, 0 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema and the volume are under the new one, with their original ids
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        -=== The state tracks the new paths
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 3 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -223,3 +175,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 3 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_itff3phkljed3kaq7pbue3fhee.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_itff3phkljed3kaq7pbue3fhee.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_itff3phkljed3kaq7pbue3fhee",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=67494298/002/output.txt
        @@ -73,7 +73,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -92,8 +92,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -111,7 +111,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -133,8 +133,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -146,65 +146,21 @@
         === Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Updated schemas.schema1
        -Updated volumes.volume1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 3 changed, 0 deleted, 0 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema and the volume are under the new one, with their original ids
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        -=== The state tracks the new paths
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 3 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -223,3 +175,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 3 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_xpd5deveybbofgoi3rrjt7ms2u.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_xpd5deveybbofgoi3rrjt7ms2u.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_xpd5deveybbofgoi3rrjt7ms2u",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
TestAccept/bundle/resources/catalogs/rename/DMS=true: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=true3745769749/002/output.txt
        @@ -73,7 +73,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -92,8 +92,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -111,7 +111,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -133,8 +133,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -146,65 +146,21 @@
         === Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Updated schemas.schema1
        -Updated volumes.volume1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 3 changed, 0 deleted, 0 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema and the volume are under the new one, with their original ids
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        -=== The state tracks the new paths
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 3 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -223,3 +175,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 3 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_6li6zn7jjra5tc3cxvu7adrsxe.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_6li6zn7jjra5tc3cxvu7adrsxe.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_6li6zn7jjra5tc3cxvu7adrsxe",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrenameDMS=true4231716986/002/output.txt
        @@ -73,7 +73,7 @@
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -92,8 +92,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -111,7 +111,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "recreate",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -133,8 +133,8 @@
             },
             "changes": {
               "catalog_name": {
        -        "action": "update_id",
        -        "reason": "parent_renamed",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
                 "new": "test_catalog_renamed_[UNIQUE_NAME]",
                 "remote": "test_catalog_[UNIQUE_NAME]"
        @@ -146,65 +146,21 @@
         === Deploy renames the catalog. UC moves the schema and the volume with it, so they get no request
         >>> [CLI] bundle deploy
         Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Updated catalogs.catalog1
        -Updated schemas.schema1
        -Updated volumes.volume1
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 3 changed, 0 deleted, 0 unchanged
         
        ->>> print_requests.py //unity-catalog
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.1/unity-catalog/catalogs/test_catalog_[UNIQUE_NAME]",
        -  "body": {
        -    "comment": "",
        -    "custom_max_retention_hours": 0,
        -    "new_name": "test_catalog_renamed_[UNIQUE_NAME]"
        -  }
        -}
        +This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        +  recreate resources.schemas.schema1
         
        -=== The old catalog is gone and the schema and the volume are under the new one, with their original ids
        -old catalog is gone
        +This action will result in the deletion or recreation of the following volumes.
        +For managed volumes, the files stored in the volume are also deleted from your
        +cloud tenant within 30 days. For external volumes, the metadata about the volume
        +is removed from the catalog, but the underlying files are not deleted:
        +  recreate resources.volumes.volume1
        +Error: the deployment requires destructive actions, but the current console does not support prompting.
        +Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        +To proceed, use --auto-approve after reviewing the plan above.
         
        ->>> [CLI] schemas get test_catalog_renamed_[UNIQUE_NAME].myschema
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "schema_id": "[SCHEMA_ID]"
        -}
        +Files: 1 uploaded, 0 deleted
         
        ->>> [CLI] volumes read test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume
        -{
        -  "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume",
        -  "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -  "volume_id": "[VOLUME_ID]"
        -}
        -
        -=== The state tracks the new paths
        ->>> [CLI] bundle summary --output json
        -{
        -  "catalogs": {
        -    "catalog1": "test_catalog_renamed_[UNIQUE_NAME]"
        -  },
        -  "schemas": {
        -    "schema1": "test_catalog_renamed_[UNIQUE_NAME].myschema"
        -  },
        -  "volumes": {
        -    "volume1": "test_catalog_renamed_[UNIQUE_NAME].myschema.myvolume"
        -  }
        -}
        -
        -=== Redeploy is a no-op
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default/files...
        -Files: 0 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 0 deleted, 3 unchanged
        -
        ->>> print_requests.py //unity-catalog
        -
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.catalogs.catalog1
        @@ -223,3 +175,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle-[UNIQUE_NAME]/default
         
         Destroy: 3 deleted
        +
        +Exit code: 1
        
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_dv46fzunnfbz7n76lfcrtjvp4a.myschema.myvolume"
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_dv46fzunnfbz7n76lfcrtjvp4a.myschema",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_dv46fzunnfbz7n76lfcrtjvp4a",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
TestAccept/bundle/resources/catalogs/rename_all_out_of_band/DMS=: branch ✅ | main (663e1f7) ❌ | latest (v1.24.0) ❌

main (663e1f7):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename_all_out_of_band/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrename_all_out_of_bandDMS=1985539591/002/output.txt
        @@ -51,49 +51,35 @@
             }
           },
           "resources.schemas.schema1": {
        -    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema2",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "create",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
                 "name": "myschema2"
               }
             },
        -    "remote_state": {
        -      "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -      "catalog_type": "MANAGED_CATALOG",
        -      "created_at": [UNIX_TIME_MILLIS][0],
        -      "created_by": "[USERNAME]",
        -      "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2",
        -      "name": "myschema2",
        -      "owner": "[USERNAME]",
        -      "schema_id": "[SCHEMA_ID]"
        -    },
             "changes": {
               "catalog_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
        -        "new": "test_catalog_renamed_[UNIQUE_NAME]",
        -        "remote": "test_catalog_renamed_[UNIQUE_NAME]"
        +        "new": "test_catalog_renamed_[UNIQUE_NAME]"
               },
               "name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "myschema",
        -        "new": "myschema2",
        -        "remote": "myschema2"
        +        "new": "myschema2"
               }
             }
           },
           "resources.volumes.volume1": {
        -    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -104,7 +68,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "create",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -113,38 +77,24 @@
                 "volume_type": "MANAGED"
               }
             },
        -    "remote_state": {
        -      "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -      "created_at": [UNIX_TIME_MILLIS][1],
        -      "created_by": "[USERNAME]",
        -      "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2",
        -      "name": "myvolume2",
        -      "owner": "[USERNAME]",
        -      "schema_name": "myschema2",
        -      "volume_id": "[VOLUME_ID]",
        -      "volume_type": "MANAGED"
        -    },
             "changes": {
               "catalog_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
        -        "new": "test_catalog_renamed_[UNIQUE_NAME]",
        -        "remote": "test_catalog_renamed_[UNIQUE_NAME]"
        +        "new": "test_catalog_renamed_[UNIQUE_NAME]"
               },
               "name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "update_id",
        +        "reason": "id_changes",
                 "old": "myvolume",
        -        "new": "myvolume2",
        -        "remote": "myvolume2"
        +        "new": "myvolume2"
               },
               "schema_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "myschema",
        -        "new": "myschema2",
        -        "remote": "myschema2"
        +        "new": "myschema2"
               }
             }
           }
        @@ -160,9 +101,9 @@
         API error_code: CATALOG_ALREADY_EXISTS
         API message: Catalog 'test_catalog_renamed_[UNIQUE_NAME]' already exists
         
        -Error: cannot update_id resources.schemas.schema1: dependency failed: resources.catalogs.catalog1
        +Error: cannot create resources.schemas.schema1: dependency failed: resources.catalogs.catalog1
         
        -Error: cannot update_id resources.volumes.volume1: dependency failed: resources.catalogs.catalog1
        +Error: cannot create resources.volumes.volume1: dependency failed: resources.catalogs.catalog1
         
         Files: 3 uploaded, 0 deleted
         
        
    acceptance_test.go:1123: 
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/catalogs",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "name": "test_catalog_hktpwhaj2fb7hgss5mirwgc7xq"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/schemas",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "catalog_name": "test_catalog_hktpwhaj2fb7hgss5mirwgc7xq",
        LOG.deploy_requests:     "name": "myschema"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/volumes",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "catalog_name": "test_catalog_hktpwhaj2fb7hgss5mirwgc7xq",
        LOG.deploy_requests:     "name": "myvolume",
        LOG.deploy_requests:     "schema_name": "myschema",
        LOG.deploy_requests:     "volume_type": "MANAGED"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "POST",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs",
        LOG.destroy_requests:   "body": {
        LOG.destroy_requests:     "name": "test_catalog_renamed_hktpwhaj2fb7hgss5mirwgc7xq"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_hktpwhaj2fb7hgss5mirwgc7xq",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
    acceptance_test.go:1123: 
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_hktpwhaj2fb7hgss5mirwgc7xq.myschema.myvolume",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "myvolume2"
        LOG.rename_requests:   }
        LOG.rename_requests: }
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_hktpwhaj2fb7hgss5mirwgc7xq.myschema",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "myschema2"
        LOG.rename_requests:   }
        LOG.rename_requests: }
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_hktpwhaj2fb7hgss5mirwgc7xq",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "test_catalog_renamed_hktpwhaj2fb7hgss5mirwgc7xq"
        LOG.rename_requests:   }
        LOG.rename_requests: }

latest (v1.24.0):

acceptance_test.go:1345: Diff:
        --- bundle/resources/catalogs/rename_all_out_of_band/output.txt
        +++ /tmp/TestAcceptbundleresourcescatalogsrename_all_out_of_bandDMS=1802558847/002/output.txt
        @@ -51,49 +51,35 @@
             }
           },
           "resources.schemas.schema1": {
        -    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema2",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
                 "label": "${resources.catalogs.catalog1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "create",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
                 "name": "myschema2"
               }
             },
        -    "remote_state": {
        -      "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -      "catalog_type": "MANAGED_CATALOG",
        -      "created_at": [UNIX_TIME_MILLIS][0],
        -      "created_by": "[USERNAME]",
        -      "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2",
        -      "name": "myschema2",
        -      "owner": "[USERNAME]",
        -      "schema_id": "[SCHEMA_ID]"
        -    },
             "changes": {
               "catalog_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
        -        "new": "test_catalog_renamed_[UNIQUE_NAME]",
        -        "remote": "test_catalog_renamed_[UNIQUE_NAME]"
        +        "new": "test_catalog_renamed_[UNIQUE_NAME]"
               },
               "name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "myschema",
        -        "new": "myschema2",
        -        "remote": "myschema2"
        +        "new": "myschema2"
               }
             }
           },
           "resources.volumes.volume1": {
        -    "id": "test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2",
             "depends_on": [
               {
                 "node": "resources.catalogs.catalog1",
        @@ -104,7 +68,7 @@
                 "label": "${resources.schemas.schema1.name}"
               }
             ],
        -    "action": "update_id",
        +    "action": "create",
             "new_state": {
               "value": {
                 "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        @@ -113,38 +77,24 @@
                 "volume_type": "MANAGED"
               }
             },
        -    "remote_state": {
        -      "catalog_name": "test_catalog_renamed_[UNIQUE_NAME]",
        -      "created_at": [UNIX_TIME_MILLIS][1],
        -      "created_by": "[USERNAME]",
        -      "full_name": "test_catalog_renamed_[UNIQUE_NAME].myschema2.myvolume2",
        -      "name": "myvolume2",
        -      "owner": "[USERNAME]",
        -      "schema_name": "myschema2",
        -      "volume_id": "[VOLUME_ID]",
        -      "volume_type": "MANAGED"
        -    },
             "changes": {
               "catalog_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "test_catalog_[UNIQUE_NAME]",
        -        "new": "test_catalog_renamed_[UNIQUE_NAME]",
        -        "remote": "test_catalog_renamed_[UNIQUE_NAME]"
        +        "new": "test_catalog_renamed_[UNIQUE_NAME]"
               },
               "name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "update_id",
        +        "reason": "id_changes",
                 "old": "myvolume",
        -        "new": "myvolume2",
        -        "remote": "myvolume2"
        +        "new": "myvolume2"
               },
               "schema_name": {
        -        "action": "skip",
        -        "reason": "remote_already_set",
        +        "action": "recreate",
        +        "reason": "id_field",
                 "old": "myschema",
        -        "new": "myschema2",
        -        "remote": "myschema2"
        +        "new": "myschema2"
               }
             }
           }
        @@ -160,9 +101,9 @@
         API error_code: CATALOG_ALREADY_EXISTS
         API message: Catalog 'test_catalog_renamed_[UNIQUE_NAME]' already exists
         
        -Error: cannot update_id resources.schemas.schema1: dependency failed: resources.catalogs.catalog1
        +Error: cannot create resources.schemas.schema1: dependency failed: resources.catalogs.catalog1
         
        -Error: cannot update_id resources.volumes.volume1: dependency failed: resources.catalogs.catalog1
        +Error: cannot create resources.volumes.volume1: dependency failed: resources.catalogs.catalog1
         
         Files: 3 uploaded, 0 deleted
         
        
    acceptance_test.go:1123: 
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/catalogs",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "name": "test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/schemas",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "catalog_name": "test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4",
        LOG.deploy_requests:     "name": "myschema"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
        LOG.deploy_requests: {
        LOG.deploy_requests:   "method": "POST",
        LOG.deploy_requests:   "path": "/api/2.1/unity-catalog/volumes",
        LOG.deploy_requests:   "body": {
        LOG.deploy_requests:     "catalog_name": "test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4",
        LOG.deploy_requests:     "name": "myvolume",
        LOG.deploy_requests:     "schema_name": "myschema",
        LOG.deploy_requests:     "volume_type": "MANAGED"
        LOG.deploy_requests:   }
        LOG.deploy_requests: }
    acceptance_test.go:1123: 
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "POST",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs",
        LOG.destroy_requests:   "body": {
        LOG.destroy_requests:     "name": "test_catalog_renamed_5qhk5zdoq5c7jizlerg5kdgyf4"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
        LOG.destroy_requests: {
        LOG.destroy_requests:   "method": "DELETE",
        LOG.destroy_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_renamed_5qhk5zdoq5c7jizlerg5kdgyf4",
        LOG.destroy_requests:   "q": {
        LOG.destroy_requests:     "force": "true"
        LOG.destroy_requests:   }
        LOG.destroy_requests: }
    acceptance_test.go:1123: 
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/volumes/test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4.myschema.myvolume",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "myvolume2"
        LOG.rename_requests:   }
        LOG.rename_requests: }
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/schemas/test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4.myschema",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "myschema2"
        LOG.rename_requests:   }
        LOG.rename_requests: }
        LOG.rename_requests: {
        LOG.rename_requests:   "method": "PATCH",
        LOG.rename_requests:   "path": "/api/2.1/unity-catalog/catalogs/test_catalog_5qhk5zdoq5c7jizlerg5kdgyf4",
        LOG.rename_requests:   "body": {
        LOG.rename_requests:     "new_name": "test_catalog_renamed_5qhk5zdoq5c7jizlerg5kdgyf4"
        LOG.rename_requests:   }
        LOG.rename_requests: }

20 more failure details omitted, see the full report in the run.

@denik
denik force-pushed the denik/schemas-remove branch from c643054 to 3aabe1b Compare November 4, 2026 13:15
@denik
denik changed the base branch from main to denik/grants-rekey November 4, 2026 13:16
@denik
denik added this pull request to stack #7346 November 4, 2026 13:16
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 6bdb8f0

Run: 42237223919

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 316 30 5:07
✅​ aws-windows-latest-4core-16gb 318 28 6:46
✅​ azure linux-2core-8gb 315 30 5:07
✅​ azure-windows-latest-4core-16gb 317 28 7:01
✅​ gcp linux-2core-8gb 316 30 5:46
✅​ gcp-windows-latest-4core-16gb 318 28 6:37
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:16 azure-windows-latest-4core-16gb TestAccept
3:06 aws-windows-latest-4core-16gb TestAccept
3:05 gcp-windows-latest-4core-16gb TestAccept

@denik
denik force-pushed the denik/schemas-remove branch 4 times, most recently from 5f6e047 to 0d42d75 Compare November 4, 2026 15:00
Base automatically changed from denik/grants-rekey to main November 4, 2026 15:33
@denik
denik force-pushed the denik/schemas-remove branch 2 times, most recently from 3678e96 to 891fceb Compare November 4, 2026 16:43
@denik
denik removed this pull request from stack #7346 November 4, 2026 16:44
@denik
denik changed the base branch from main to denik/permissions-rekey November 4, 2026 16:45
@denik
denik added this pull request to stack #7362 November 4, 2026 16:45
@denik
denik force-pushed the denik/schemas-remove branch from 891fceb to fe7fb69 Compare November 4, 2026 16:50
@denik
denik marked this pull request as ready for review November 5, 2026 12:59
@denik
denik requested review from a team as code owners November 5, 2026 12:59
@denik
denik requested a review from shreyas-goenka November 5, 2026 12:59
@denik
denik force-pushed the denik/schemas-remove branch from a4a9475 to 6845544 Compare November 5, 2026 13:09
Base automatically changed from denik/permissions-rekey to main November 5, 2026 13:57
denik and others added 4 commits November 5, 2026 14:57
Changing a schema's name used to delete and recreate it. It is now an
updatable ID field renamed via PATCH new_name, which keeps the schema and
everything in it.

UC moves the children of a renamed catalog or schema with it. A child
volume (or a schema in a renamed catalog) whose catalog_name/schema_name
references the parent's name was planned as a recreate, and its create
then failed with RESOURCE_ALREADY_EXISTS on every deploy. The planner now
re-keys such children (update_id, reason parent_renamed), and they are
addressed under their new parents.

The test server now moves children on catalog/schema rename and rejects
duplicate volume names, matching UC.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
A captured terraform fixture (migrate/command/basic) deploys the same volume
name from two targets. The plan goldens already catch a regression to
recreate, so the duplicate check is not needed.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
denik and others added 11 commits November 5, 2026 14:57
Also restores the grants/schemas/change_name golden for the in-place rename,
which the rebase onto denik/grants-rekey dropped.

Co-authored-by: Isaac <no-reply@databricks.com>
Also restores the grants/schemas/change_name golden for the in-place rename.

Co-authored-by: Isaac <no-reply@databricks.com>
schema-rename now renames in place, so it no longer covers the schema recreate.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ename

UC moves schemas and volumes with their renamed catalog or schema, so the
re-key needs no update. Read the child instead to record its full name as UC
spells it.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ename

Co-authored-by: Isaac <no-reply@databricks.com>
Azure and GCP return their own volume storage_location and predictive
optimization metastore, and UC may touch a schema's updated_at after create.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Like the other DoUpdateWithID implementations, take the new ID from config, so a
child moved by its parent's rename needs no request at all.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/schemas-remove branch from 4f7fd4e to 27ceb82 Compare November 5, 2026 13:57
@denik denik changed the title Rename schemas in place in the direct engine Support schema rename and improve catalog rename Nov 5, 2026
Comment thread bundle/direct/dresources/schema.go Outdated
return fullName, nil, nil
}

response, err := r.client.Schemas.Update(ctx, makeUpdateSchema(fullName, newName, config))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IIRC including other fields during a rename caused issues.

Also; what happens if we rename to something that UC considers equivalent?

E.g. case change (via EqualFold)?

…lied

A deploy can stop after renaming a schema but before re-keying its volume.
The next plan then saw no rename in progress, read the volume at its old path,
got 404, and planned a create, which fails on UC with RESOURCE_ALREADY_EXISTS.

An update_id now records the old values of the fields it changes (renamed_from)
in the same state write as the new ID. A child whose parent is not being renamed
in the plan follows that recorded rename instead, and is not planned as a create
just because its read at the old ID found nothing.

Co-authored-by: Isaac <no-reply@databricks.com>
denik and others added 5 commits November 6, 2026 12:10
…amed_from

When the read at the recorded ID finds nothing, the plan reads at the ID the
config gives the resource and takes what it finds only if its stable ID
(schema_id, volume_id, now saved in the state entry and the DMS envelope)
matches. This covers a deploy that stopped after renaming the parent and a
rename done out of band, and never adopts a different object of the same name.
It replaces renamed_from, which missed repeated renames and could not tell a
rename from a recreate.

The test server now deletes children with a forced catalog/schema delete and
rejects a catalog create under a taken name, like UC. The migrate fixtures
dropped the out-of-band catalog create that the scripts already run.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…of stable_id

The internal ID now lives in the volume and schema state (VolumeState,
SchemaState), set from the API responses and copied by RemapState; the
framework reads it back through a new optional InternalID method. This
replaces the stable_id field on the state entry and in the DMS envelope.

A new drop_changes lifecycle rule leaves the always-different volume_id and
schema_id (config never sets them) out of the plan.

Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants