Modifying a data table column name on an existing table fails
Closed this issue · 2 comments
When I modify an existing data table column the v1.15 provider will attempt to modify the data table. Since the column names are immutable, once created this should result in a table re-create.
If only the "title" property changes, this change can be made without a re-create. Similarly, a column add can be performed without a re-create, but a column deletion will require a re-create.
Hi Rich
These rules are difficult to mirror in the provider. If I add ForceNew: true
to the name field, the re create will occur when the string is updated or when a properties block is removed (which is good - two birds one stone), but it will also cause a re create when a block is added to the list. As far as I'm aware, there is no way to implement some sort of ForceNew-on-condition logic. It would take a lot of hacking on our end.
I'll raise the issue within the team to decide if we should implement the correct behaviour, but we may just have to make the rules clear to the user in the docs and leave it to them to follow them.
Regards
Charlie
Update on this issue:
The correct ForceNew logic could be achievable after playing around with this customdiff
feature - https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/customdiff#ForceNewIfChange
Work is being tracked by ticket DEVENGAGE-2003