Skip to content

Commit 7309250

Browse files
mgyuchtalexott
andauthored
Add schema_id to the output of databricks_schema resource (#4773)
## Changes Schema now exports a stable UUID identifier in the `schema_id` field. This PR adds this to the model for schema as a computed attribute. ## Tests Manually verified that the schema_id was populated in state in GCP. I don't want to add a test for this per se since it's possible that it isn't populated in all environments (yet). --------- Co-authored-by: Alex Ott <[email protected]>
1 parent 9d1381e commit 7309250

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
### New Features and Improvements
88

99
* Support for `uc_securable` resource in `databricks_app` ([#4767](https://github.com/databricks/terraform-provider-databricks/pull/4767))
10+
* Add `schema_id` to the output of `databricks_schema` resource ([#4773](https://github.com/databricks/terraform-provider-databricks/pull/4773)).
1011

1112
### Bug Fixes
1213

catalog/resource_schema.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type SchemaInfo struct {
1919
Owner string `json:"owner,omitempty" tf:"computed"`
2020
MetastoreID string `json:"metastore_id,omitempty" tf:"computed"`
2121
FullName string `json:"full_name,omitempty" tf:"computed"`
22+
SchemaID string `json:"schema_id" tf:"computed"`
2223
}
2324

2425
func ResourceSchema() common.Resource {

catalog/schema_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const catalogTemplate = `
1818
`
1919

2020
func TestUcAccSchema(t *testing.T) {
21+
acceptance.LoadUcwsEnv(t)
2122
acceptance.UnityWorkspaceLevel(t, acceptance.Step{
2223
Template: catalogTemplate + `
2324
data "databricks_catalogs" "all" {

docs/data-sources/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ In addition to all arguments above, the following attributes are exported:
5555
* `name` - Name of schema, relative to parent catalog.
5656
* `owner` - the identifier of the user who owns the schema
5757
* `properties` - map of properties set on the schema
58-
* `schema_id` - the unique identifier of the volume
58+
* `schema_id` - the unique identifier of the schema
5959
* `storage_location` - the storage location on the cloud.
6060
* `storage_root` - storage root URL for managed tables within schema.
6161
* `updated_at` - the timestamp of the last time changes were made to the schema

docs/resources/schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The following arguments are required:
4848
In addition to all arguments above, the following attributes are exported:
4949

5050
* `id` - ID of this schema in form of `<catalog_name>.<name>`.
51+
* `schema_id` - The unique identifier of the schema.
5152

5253
## Import
5354

0 commit comments

Comments
 (0)