Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
fc43083
Rename schemas in place in the direct engine
denik Nov 4, 2026
956cff0
Link PR in changelog fragment
denik Nov 4, 2026
6e0fe9b
testserver: keep volume create lenient
denik Nov 4, 2026
1903d72
Drop engine mention from changelog entry
denik Nov 4, 2026
80a4f3d
acc: drop text plan where the JSON plan already shows it
denik Nov 4, 2026
2723127
acc: show only the plan field each rename test is about
denik Nov 4, 2026
6bb6f0f
acc: point migrate recreate comments at schema-catalog-change
denik Nov 5, 2026
4e513bc
acc: show the whole plan in the rename tests
denik Nov 5, 2026
f3a59d2
direct: don't send an empty update to a child moved by its parent's r…
denik Nov 5, 2026
ad2b996
acc: update, rename and recreate a volume after its schema is renamed
denik Nov 5, 2026
6ffe8a9
acc: sort requests of the parallel schema creates
denik Nov 5, 2026
4c9238f
acc: a job reading a volume's full_name and id follows its schema's r…
denik Nov 5, 2026
cb1b16f
acc: drop cloud-specific fields from the rename plans
denik Nov 5, 2026
4bb3417
acc: show preserved schema and volume ids through replacements
denik Nov 5, 2026
688fda9
direct: build the re-keyed child's ID from config instead of reading it
denik Nov 5, 2026
a9b667f
direct: follow a parent rename that an interrupted deploy already app…
denik Nov 5, 2026
8496ce6
direct: find a moved schema or volume by its stable ID instead of ren…
denik Nov 6, 2026
e913e17
acc: out-of-band renames and recreates of volumes, schemas and catalogs
denik Nov 6, 2026
ae3102e
acc: normalize a killed CLI on Windows in the interrupted rename tests
denik Nov 6, 2026
17d5e26
direct: record volume_id and schema_id in the resource state instead …
denik Nov 6, 2026
bd7a2ac
Regenerate apitypes and volume spec rules for the new state types
denik Nov 9, 2026
e45d36f
direct: ignore volume_id and schema_id changes instead of dropping them
denik Nov 9, 2026
3a86513
acc: show the skipped volume_id and schema_id changes in plans
denik Nov 9, 2026
1aa7f3f
acc: a volume follows its catalog and schema renamed in one deploy
denik Nov 9, 2026
2b5169d
acc: keep the captured migrate fixtures; let the replay create the ca…
denik Nov 9, 2026
6b609e4
direct: classify a parent-renamed ID field as update_id directly
denik Nov 9, 2026
7b966d9
Point comments at followsParentRename
denik Nov 9, 2026
a5b42ad
direct: apply re-key-only update_id in the framework and record inter…
denik Nov 9, 2026
d5ce963
acc: renames with another field changed, and case-only renames
denik Nov 9, 2026
b1a45e4
direct: match the internal ID field structurally, ahead of the skip c…
denik Nov 9, 2026
9ed5ded
acc: regenerate for state-only re-keys and recorded schema_id
denik Nov 9, 2026
3f8a5ad
deployplan: name the reason at the call site with Changes.HasOnlySing…
denik Nov 9, 2026
f37978e
acc: mark the catalog out-of-band rename tests with Badness (pre-exis…
denik Nov 9, 2026
b09c346
acc: drop errcode from commands that do not fail
denik Nov 10, 2026
40d7b23
Shorten the schema rename changelog entry
denik Nov 10, 2026
a3c1f0b
acc: show the whole plan in the interrupted tests, without timestamps…
denik Nov 10, 2026
1e6a015
Apply suggestion from @janniklasrose
denik Nov 10, 2026
f952d4f
acc: a volume recreated while its schema is renamed (Badness)
denik Nov 10, 2026
55689e6
direct: recreate a resource where its renamed parent moved it
denik Nov 10, 2026
d2b7128
acc: also deploy the key rename tests from a saved plan (READPLAN)
denik Nov 10, 2026
7ab54eb
acc: regenerate the PR's goldens after rebasing on main
denik Nov 10, 2026
e268355
acc: re-key a mixed-case volume under its renamed schema; testserver:…
denik Nov 10, 2026
dd06627
direct: follow a parent rename only with IDFromState (review B4)
denik Nov 10, 2026
80e8471
direct: check generated ID fields for unresolved references too (revi…
denik Nov 10, 2026
908b0d7
direct: report the ID that was read when a moved resource fails to lo…
denik Nov 10, 2026
04a0154
direct: collect parent renames only for types that can follow one (re…
denik Nov 10, 2026
5804baf
dresources: show the new state types in the IResource examples (revie…
denik Nov 10, 2026
a248efc
acc: restore the internal_id skips main's UUID renumbering dropped fr…
denik Nov 10, 2026
231bf35
acc: a state without schema_id/volume_id cannot follow an out-of-band…
denik Nov 10, 2026
894f9b0
acc: state_present deletes the replayed schema before creating it again
denik Nov 10, 2026
53a06c5
direct: record a missing internal ID with a state-only update (review…
denik Nov 10, 2026
2a49a4c
statemgmt: record internal IDs when migrating from terraform on deplo…
denik Nov 11, 2026
e5222b3
migrate: take schema_id from the terraform state (review A3)
denik Nov 11, 2026
3ce8cf4
acc: the invariant replay tests do not repeat the synced table init's…
denik Nov 11, 2026
aedd0ad
acc: the synced table terraform fixture holds only terraform's requests
denik Nov 11, 2026
eaf3908
migrate: read volume_id for bundle deployment migrate (review A3)
denik Nov 11, 2026
2bf2ffd
acc: deploy the old-state and recreate-in-renamed-schema tests from a…
denik Nov 11, 2026
cb5c958
acc: destroy after an out-of-band rename, and a foreign schema at the…
denik Nov 11, 2026
6041de6
acc: a forbidden read at the config's name fails the plan (review B3,…
denik Nov 11, 2026
b87ef48
direct: a failed lookup for a moved resource only warns (review B3)
denik Nov 11, 2026
aa83943
Mention finding a renamed schema or volume in the changelog entry
denik Nov 11, 2026
ccb9119
acc: regenerate for title's own trailing newline (main #7003); restor…
denik Nov 11, 2026
dec3b6f
acc: restore the recorded schema_id/volume_id in goldens the rebase r…
denik Nov 12, 2026
e56021e
direct: collect parent renames only for types that can follow one, wi…
denik Nov 12, 2026
232956f
statemgmt: say which internal ID the migration's plan check supplies …
denik Nov 12, 2026
1e2e3bb
direct: a bind whose only plan is a state-only update needs no confir…
denik Nov 12, 2026
2b719a8
direct: references to a state-only update read the remote state (revi…
denik Nov 12, 2026
abc9007
direct: re-key only the field that references the renamed parent (rev…
denik Nov 12, 2026
029989b
direct: recreate a model or secret where its renamed schema moved it …
denik Nov 12, 2026
daba26b
testserver: store volumes under the lowercased full name they are loo…
denik Nov 12, 2026
032112a
direct: never re-key a resource's own name to follow its parent (revi…
denik Nov 13, 2026
0b9652e
direct: a state-only update does not need DoUpdate (review D7)
denik Nov 13, 2026
a1a8432
direct: log a failed optional internal-ID read at debug level (review…
denik Nov 13, 2026
b719f14
direct: share the pure-reference parsing and the parent-follow condit…
denik Nov 13, 2026
7034294
Make the changelog entry mirror the PR title
denik Nov 13, 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/schema-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Rename schemas in place; schemas and volumes follow a renamed catalog or schema. ([#7343](https://github.com/databricks/cli/pull/7343))
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Files: 0 uploaded, 0 deleted
"catalog_name": "main",
"name": "myvolume",
"schema_name": "myschema",
"volume_id": "[UUID]",
"volume_type": "MANAGED"
}
}
Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/volume/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

=== Create a pre-defined volume:

>>> [CLI] bundle deployment bind volume1 main.test-schema-[UNIQUE_NAME].volume-[UNIQUE_NAME] --auto-approve
>>> [CLI] bundle deployment bind volume1 main.test-schema-[UNIQUE_NAME].volume-[UNIQUE_NAME]
Successfully bound volume with an id 'main.test-schema-[UNIQUE_NAME].volume-[UNIQUE_NAME]'
Run 'bundle deploy' to deploy changes to your workspace

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/deployment/bind/volume/script
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cleanupRemoveVolume() {
}
trap cleanupRemoveVolume EXIT

trace $CLI bundle deployment bind volume1 "${VOLUME_FULL_NAME}" --auto-approve
trace $CLI bundle deployment bind volume1 "${VOLUME_FULL_NAME}"

trace $CLI bundle deploy

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 @@ -48,7 +48,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 @@ -66,7 +66,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 @@ -90,7 +90,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
"__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 @@ -48,7 +48,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 @@ -66,7 +66,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 @@ -128,7 +128,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 @@ -53,7 +53,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 @@ -139,7 +139,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 @@ -166,7 +166,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 @@ -176,7 +176,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 @@ -48,7 +48,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 @@ -66,7 +66,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 @@ -93,7 +93,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 @@ -104,7 +104,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 @@ -192,7 +193,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 @@ -13,7 +13,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 @@ -40,7 +40,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 @@ -51,7 +51,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 @@ -103,7 +104,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 @@ -114,7 +115,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 @@ -161,7 +163,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 @@ -48,7 +48,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 @@ -66,7 +66,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 @@ -93,7 +93,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 @@ -104,7 +104,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 @@ -164,7 +165,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 @@ -182,7 +183,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 @@ -209,7 +210,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 @@ -220,7 +221,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
36 changes: 6 additions & 30 deletions acceptance/bundle/migrate/auto/schema-rename/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,16 @@

>>> replay_tfstate.py terraform-requests.json terraform.tfstate

=== Rename the schema (an immutable id field). Without --auto-approve the recreate is refused
=== Rename the schema (an updatable id field) and deploy on direct

>>> 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.
>>> 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

Expand Down
Loading
Loading