diff --git a/.changelog/12289.txt b/.changelog/12289.txt new file mode 100644 index 00000000000..1b1372ca805 --- /dev/null +++ b/.changelog/12289.txt @@ -0,0 +1,3 @@ +```release-note:bug +sql: fixed edition downgrade failure for an `ENTERPRISE_PLUS` instance with data cache enabled. +``` \ No newline at end of file diff --git a/google/services/sql/resource_sql_database_instance.go b/google/services/sql/resource_sql_database_instance.go index 0d00c6da590..d132d569f4e 100644 --- a/google/services/sql/resource_sql_database_instance.go +++ b/google/services/sql/resource_sql_database_instance.go @@ -2026,6 +2026,7 @@ func resourceSqlDatabaseInstanceUpdate(d *schema.ResourceData, meta interface{}) instance.Settings.SettingsVersion = int64(_settings["version"].(int)) // Collation cannot be included in the update request instance.Settings.Collation = "" + instance.Settings.DataCacheConfig = expandDataCacheConfig(_settings["data_cache_config"].([]interface{})) // Lock on the master_instance_name just in case updating any replica // settings causes operations on the master. diff --git a/google/services/sql/resource_sql_database_instance_test.go b/google/services/sql/resource_sql_database_instance_test.go index 7bcc4b706e2..80ca8657fc2 100644 --- a/google/services/sql/resource_sql_database_instance_test.go +++ b/google/services/sql/resource_sql_database_instance_test.go @@ -1881,7 +1881,6 @@ func TestAccSqlDatabaseInstance_Postgres_Edition_Upgrade(t *testing.T) { } func TestAccSqlDatabaseInstance_Edition_Downgrade(t *testing.T) { - t.Skip("https://github.com/hashicorp/terraform-provider-google/issues/20010") t.Parallel() enterprisePlusTier := "db-perf-optimized-N-2" enterpriseTier := "db-custom-2-13312"