Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
1cbe0b9
Rename schemas in place in the direct engine
denik Nov 4, 2026
24a6f48
Link PR in changelog fragment
denik Nov 4, 2026
0842bbe
testserver: keep volume create lenient
denik Nov 4, 2026
125e79f
Drop engine mention from changelog entry
denik Nov 4, 2026
335ba63
acc: drop text plan where the JSON plan already shows it
denik Nov 4, 2026
be3c668
acc: show only the plan field each rename test is about
denik Nov 4, 2026
41bc9d0
acc: point migrate recreate comments at schema-catalog-change
denik Nov 5, 2026
2e0602e
acc: show the whole plan in the rename tests
denik Nov 5, 2026
3ce7407
direct: don't send an empty update to a child moved by its parent's r…
denik Nov 5, 2026
f2f6799
acc: update, rename and recreate a volume after its schema is renamed
denik Nov 5, 2026
b35eb68
acc: sort requests of the parallel schema creates
denik Nov 5, 2026
5f77561
acc: a job reading a volume's full_name and id follows its schema's r…
denik Nov 5, 2026
46b8a2d
acc: drop cloud-specific fields from the rename plans
denik Nov 5, 2026
a15c6a0
acc: show preserved schema and volume ids through replacements
denik Nov 5, 2026
7f25590
direct: build the re-keyed child's ID from config instead of reading it
denik Nov 5, 2026
3886edf
direct: follow a parent rename that an interrupted deploy already app…
denik Nov 5, 2026
82dc58a
direct: find a moved schema or volume by its stable ID instead of ren…
denik Nov 6, 2026
fd75691
acc: out-of-band renames and recreates of volumes, schemas and catalogs
denik Nov 6, 2026
c9b0eaa
acc: normalize a killed CLI on Windows in the interrupted rename tests
denik Nov 6, 2026
40df1d1
direct: record volume_id and schema_id in the resource state instead …
denik Nov 6, 2026
0de3e04
Regenerate apitypes and volume spec rules for the new state types
denik Nov 9, 2026
55623a4
direct: ignore volume_id and schema_id changes instead of dropping them
denik Nov 9, 2026
d69df0e
acc: show the skipped volume_id and schema_id changes in plans
denik Nov 9, 2026
9f9e31c
acc: a volume follows its catalog and schema renamed in one deploy
denik Nov 9, 2026
d2b5602
acc: keep the captured migrate fixtures; let the replay create the ca…
denik Nov 9, 2026
775732a
direct: classify a parent-renamed ID field as update_id directly
denik Nov 9, 2026
e1f6dab
Point comments at followsParentRename
denik Nov 9, 2026
39316f5
direct: apply re-key-only update_id in the framework and record inter…
denik Nov 9, 2026
9ac6cde
acc: renames with another field changed, and case-only renames
denik Nov 9, 2026
be14ae3
direct: match the internal ID field structurally, ahead of the skip c…
denik Nov 9, 2026
c0b2ea4
acc: regenerate for state-only re-keys and recorded schema_id
denik Nov 9, 2026
9a1b512
deployplan: name the reason at the call site with Changes.HasOnlySing…
denik Nov 9, 2026
75cd81f
acc: mark the catalog out-of-band rename tests with Badness (pre-exis…
denik Nov 9, 2026
380cd7a
acc: drop errcode from commands that do not fail
denik Nov 10, 2026
df9be36
Shorten the schema rename changelog entry
denik Nov 10, 2026
73a90ee
acc: show the whole plan in the interrupted tests, without timestamps…
denik Nov 10, 2026
9ea87dd
Apply suggestion from @janniklasrose
denik Nov 10, 2026
ec56412
acc: a volume recreated while its schema is renamed (Badness)
denik Nov 10, 2026
167897d
direct: recreate a resource where its renamed parent moved it
denik Nov 10, 2026
7a95ca7
acc: also deploy the key rename tests from a saved plan (READPLAN)
denik Nov 10, 2026
759a885
acc: regenerate the PR's goldens after rebasing on main
denik Nov 10, 2026
98fbea2
acc: re-key a mixed-case volume under its renamed schema; testserver:…
denik Nov 10, 2026
66b33c5
direct: follow a parent rename only with IDFromState (review B4)
denik Nov 10, 2026
585352b
direct: check generated ID fields for unresolved references too (revi…
denik Nov 10, 2026
cab9a55
direct: report the ID that was read when a moved resource fails to lo…
denik Nov 10, 2026
da87587
direct: collect parent renames only for types that can follow one (re…
denik Nov 10, 2026
00c95ee
dresources: show the new state types in the IResource examples (revie…
denik Nov 10, 2026
eee7d29
acc: restore the internal_id skips main's UUID renumbering dropped fr…
denik Nov 10, 2026
c60d940
acc: a state without schema_id/volume_id cannot follow an out-of-band…
denik Nov 10, 2026
4b49a87
acc: state_present deletes the replayed schema before creating it again
denik Nov 10, 2026
09ec883
direct: record a missing internal ID with a state-only update (review…
denik Nov 10, 2026
f6fd1ac
statemgmt: record internal IDs when migrating from terraform on deplo…
denik Nov 11, 2026
1b52598
migrate: take schema_id from the terraform state (review A3)
denik Nov 11, 2026
5c2d92d
acc: the invariant replay tests do not repeat the synced table init's…
denik Nov 11, 2026
a992d0a
acc: the synced table terraform fixture holds only terraform's requests
denik Nov 11, 2026
653a036
migrate: read volume_id for bundle deployment migrate (review A3)
denik Nov 11, 2026
761b7d2
acc: deploy the old-state and recreate-in-renamed-schema tests from a…
denik Nov 11, 2026
77fd1ff
acc: destroy after an out-of-band rename, and a foreign schema at the…
denik Nov 11, 2026
7bfa7ed
acc: a forbidden read at the config's name fails the plan (review B3,…
denik Nov 11, 2026
d268c45
direct: a failed lookup for a moved resource only warns (review B3)
denik Nov 11, 2026
e9ef060
Mention finding a renamed schema or volume in the changelog entry
denik Nov 11, 2026
6db773f
Read and adopt existing grants on the first bundle plan
janniklasrose Nov 9, 2026
5dccd12
Record matching adoption as a state-only update
janniklasrose Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nextchanges/bundles/grants-import-on-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Read existing grants when first adding them to a bundle so the plan shows the required changes and deployment adopts matching grants. ([#7422](https://github.com/databricks/cli/pull/7422))
1 change: 1 addition & 0 deletions .nextchanges/bundles/schema-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Rename a schema in place when its `name` changes, instead of deleting and recreating it. Schemas and volumes inside a renamed catalog or schema now follow it to the new name, and one renamed outside the bundle is found under its new name. ([#7343](https://github.com/databricks/cli/pull/7343))
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Files: 0 uploaded, 0 deleted
"catalog_name": "main",
"name": "myvolume",
"schema_name": "myschema",
"volume_id": "[UUID]",
"volume_type": "MANAGED"
}
}
Expand Down
9 changes: 5 additions & 4 deletions acceptance/bundle/dms/declined-deploy/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"error_message": "",
"resource_id": "main.dms_declined_deploy_schema_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_declined_deploy_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_declined_deploy_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][0]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand All @@ -64,7 +64,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -88,7 +88,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -98,7 +98,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"__id__": "main.dms_declined_deploy_schema_[UNIQUE_NAME]",
"state": {
"catalog_name": "main",
"name": "dms_declined_deploy_schema_[UNIQUE_NAME]"
"name": "dms_declined_deploy_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][0]"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions acceptance/bundle/dms/deployment-metadata-change/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"error_message": "",
"resource_id": "main.dms_metadata_schema_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_metadata_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_metadata_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][0]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand All @@ -64,7 +64,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand Down Expand Up @@ -125,7 +125,7 @@ A common practice is to use a username or principal name in this path, i.e. use
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand Down
9 changes: 5 additions & 4 deletions acceptance/bundle/dms/empty-grants/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
"error_message": "",
"resource_id": "main.dms_empty_grants_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_empty_grants_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"main\",\"name\":\"dms_empty_grants_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][0]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand Down Expand Up @@ -135,7 +135,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand All @@ -160,7 +160,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand All @@ -170,7 +170,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"__id__": "main.dms_empty_grants_[UNIQUE_NAME]",
"state": {
"catalog_name": "main",
"name": "dms_empty_grants_[UNIQUE_NAME]"
"name": "dms_empty_grants_[UNIQUE_NAME]",
"schema_id": "[UUID][0]"
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions acceptance/bundle/dms/failed-recreate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"error_message": "",
"resource_id": "main.dms_failed_recreate_schema_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"main\",\"comment\":\"v1\",\"name\":\"dms_failed_recreate_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"main\",\"comment\":\"v1\",\"name\":\"dms_failed_recreate_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][0]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand All @@ -64,7 +64,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -89,7 +89,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -100,7 +100,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"state": {
"catalog_name": "main",
"comment": "v1",
"name": "dms_failed_recreate_schema_[UNIQUE_NAME]"
"name": "dms_failed_recreate_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][0]"
}
}
}
Expand Down Expand Up @@ -185,7 +186,7 @@ Files: 2 uploaded, 0 deleted
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand Down
14 changes: 8 additions & 6 deletions acceptance/bundle/dms/operation-upload-fails-once/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -36,7 +36,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -47,7 +47,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"state": {
"catalog_name": "main",
"comment": "v1",
"name": "dms_upload_fails_once_schema_[UNIQUE_NAME]"
"name": "dms_upload_fails_once_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][1]"
}
}
}
Expand Down Expand Up @@ -95,7 +96,7 @@ Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand All @@ -106,7 +107,8 @@ Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
"state": {
"catalog_name": "dms_other_[UNIQUE_NAME]",
"comment": "v1",
"name": "dms_upload_fails_once_schema_[UNIQUE_NAME]"
"name": "dms_upload_fails_once_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][2]"
}
}
}
Expand Down Expand Up @@ -153,7 +155,7 @@ Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
"error_message": "",
"resource_id": "dms_other_[UNIQUE_NAME].dms_upload_fails_once_schema_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"dms_other_[UNIQUE_NAME]\",\"comment\":\"v1\",\"name\":\"dms_upload_fails_once_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"dms_other_[UNIQUE_NAME]\",\"comment\":\"v1\",\"name\":\"dms_upload_fails_once_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][2]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand Down
18 changes: 10 additions & 8 deletions acceptance/bundle/dms/successful-recreate/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"error_message": "",
"resource_id": "main.dms_successful_recreate_schema_[UNIQUE_NAME]",
"sequence_id": 0,
"state": "{\"state\":{\"catalog_name\":\"main\",\"comment\":\"v1\",\"name\":\"dms_successful_recreate_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"main\",\"comment\":\"v1\",\"name\":\"dms_successful_recreate_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][0]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand All @@ -64,7 +64,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -89,7 +89,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 1,
"features": {
"deployment_history_shadow": {}
Expand All @@ -100,7 +100,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"state": {
"catalog_name": "main",
"comment": "v1",
"name": "dms_successful_recreate_schema_[UNIQUE_NAME]"
"name": "dms_successful_recreate_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][0]"
}
}
}
Expand Down Expand Up @@ -159,7 +160,7 @@ Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
"error_message": "",
"resource_id": "dms_other_[UNIQUE_NAME].dms_successful_recreate_schema_[UNIQUE_NAME]",
"sequence_id": 1,
"state": "{\"state\":{\"catalog_name\":\"dms_other_[UNIQUE_NAME]\",\"comment\":\"v1\",\"name\":\"dms_successful_recreate_schema_[UNIQUE_NAME]\"}}",
"state": "{\"state\":{\"catalog_name\":\"dms_other_[UNIQUE_NAME]\",\"comment\":\"v1\",\"name\":\"dms_successful_recreate_schema_[UNIQUE_NAME]\",\"schema_id\":\"[UUID][2]\"}}",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
Expand All @@ -176,7 +177,7 @@ Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand All @@ -201,7 +202,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][1]",
"serial": 2,
"features": {
"deployment_history_shadow": {}
Expand All @@ -212,7 +213,8 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
"state": {
"catalog_name": "dms_other_[UNIQUE_NAME]",
"comment": "v1",
"name": "dms_successful_recreate_schema_[UNIQUE_NAME]"
"name": "dms_successful_recreate_schema_[UNIQUE_NAME]",
"schema_id": "[UUID][2]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
[
{
"method": "POST",
"path": "/api/2.1/unity-catalog/schemas",
"body": {
"catalog_name": "main",
"name": "test_synced_[UNIQUE_NAME]"
}
},
{
"method": "POST",
"path": "/api/2.0/sql/statements/",
"body": {
"statement": "CREATE TABLE main.test_synced_[UNIQUE_NAME].trips_source AS SELECT * FROM samples.nyctaxi.trips LIMIT 10",
"wait_timeout": "45s",
"warehouse_id": "8ec9edc1-db0c-40df-af8d-7580020fe61e"
}
},
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/lifecycle/prevent-destroy/script
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ update_file.py resources/pipeline.yml ' catalog: main' ' storage: "dbf
trace errcode $CLI bundle plan >>out.txt 2>&1
trace musterr $CLI bundle deploy -qq >>out.txt 2>&1

# Changing the schema name, deploy must fail because schema will be recreated
update_file.py resources/schema.yml 'name: test-schema' 'name: test-schema-new'
# Changing the schema catalog, deploy must fail because schema will be recreated
update_file.py resources/schema.yml 'catalog_name: "test-catalog"' 'catalog_name: "test-catalog-new"'
trace errcode $CLI bundle plan >>out.txt 2>&1
trace musterr $CLI bundle deploy -qq >>out.txt 2>&1

Expand Down
35 changes: 6 additions & 29 deletions acceptance/bundle/migrate/auto/schema-rename/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,15 @@
=== Replay the prior terraform deployment (captured from a real terraform run)
>>> replay_tfstate.py terraform-requests.json terraform.tfstate

=== Rename the schema (an immutable id field). Without --auto-approve the recreate is refused
>>> DATABRICKS_BUNDLE_ENGINE=direct errcode [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 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...

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.

Files: 2 uploaded, 0 deleted

Exit code: 1

>>> print_migration_telemetry
direct_migrate_recreate_planned true

=== With --auto-approve the recreate is applied on direct under the new name
>>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle deploy --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.
=== 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.
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...

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
Migrated 1 resource to direct deployment engine.
Recreated schemas.my_schema
Files: 0 uploaded, 0 deleted
Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
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
Expand Down
15 changes: 5 additions & 10 deletions acceptance/bundle/migrate/auto/schema-rename/script
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ title "Replay the prior terraform deployment (captured from a real terraform run
trace replay_tfstate.py terraform-requests.json terraform.tfstate
rm -f "$OUT_REQUESTS"

title "Rename the schema (an immutable id field). Without --auto-approve the recreate is refused"
# name is a provided id field, so a rename recreates. reconcileIDFields seeds the deployed
# name into the converted state, so the migration's plan sees a real recreate. Schemas are in
# the destructive-approval group, so without --auto-approve the deploy refuses the recreate
# (exit 1) and the migration is not committed - the run stays on terraform.
title "Rename the schema (an updatable id field) and deploy on direct"
# name is an updatable id field: the schema is renamed in place (UpdateWithID), so the deploy
# needs no --auto-approve. reconcileIDFields seeds the deployed name into the converted state,
# so the migration's plan sees a rename rather than snapshotting the new name as already applied.
update_file.py databricks.yml "myschema-$UNIQUE_NAME" "myschema-$UNIQUE_NAME-renamed"
trace DATABRICKS_BUNDLE_ENGINE=direct errcode $CLI bundle deploy
trace print_migration_telemetry

title "With --auto-approve the recreate is applied on direct under the new name"
trace DATABRICKS_BUNDLE_ENGINE=direct $CLI bundle deploy --auto-approve
trace DATABRICKS_BUNDLE_ENGINE=direct $CLI bundle deploy

title "Redeploy on direct: the schema now matches config, so the plan is a clean no-op"
trace DATABRICKS_BUNDLE_ENGINE=direct $CLI bundle deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export DATABRICKS_BUNDLE_ENGINE=

# Testserver-only: an explicit storage_root needs a registered external location on a real
# workspace, so this is not Cloud-enabled. The recreate/refusal class it covers is verified
# on cloud by schema-rename and pipeline-storage-change.
# on cloud by schema-catalog-change and pipeline-storage-change.

title "Replay the prior terraform deployment (captured from a real terraform run)"
trace replay_tfstate.py terraform-requests.json terraform.tfstate
Expand Down
Loading
Loading