Skip to content

Commit 349ae59

Browse files
committed
Block unsetting schema name for consistency
1 parent 6bbcf51 commit 349ae59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/provider/profiles_warehouse_resource.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@ func (r *profilesWarehouseResource) Update(ctx context.Context, req resource.Upd
239239
return
240240
}
241241

242+
if (plan.SchemaName.IsNull() || plan.SchemaName.IsUnknown()) && !state.SchemaName.IsNull() {
243+
resp.Diagnostics.AddError(
244+
fmt.Sprintf("Unable to update Profiles Warehouse (ID: %s)", plan.ID.ValueString()),
245+
"Cannot unset schema name",
246+
)
247+
248+
return
249+
}
250+
242251
// Only send schemaName to API if it differs from the remote state.
243252
// This prevents API failures when the schema name already exists in the warehouse.
244253
// The Segment API fails if we send a schemaName that matches the current configuration.

0 commit comments

Comments
 (0)