From 76bc18dac9ccb955cda40e8f5b94402f2b69ddb0 Mon Sep 17 00:00:00 2001 From: Jovan Manojlovic <152610450+fivetran-jovanmanojlovic@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:38:50 +0200 Subject: [PATCH] Fix Schema config column parsing and hashed read from tf file (#348) * Fix Schema config column parsing and hashed read from tf file * Add change log and update version * Fix versions --- CHANGELOG.md | 8 +++++++- fivetran/framework/core/model/connector_schema_config.go | 2 +- fivetran/framework/provider.go | 2 +- modules/connector/schema/schema_column.go | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ede1a1..d7b5b35b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.7...HEAD) +## [Unreleased](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.8...HEAD) + +## [1.2.8](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.7...v1.2.8) + +## Fixed +- Issue with connector schema config columns update +- Issue with connector schema config columns' hashed value being required in the .tf file ## [1.2.7](https://github.com/fivetran/terraform-provider-fivetran/compare/v1.2.6...v1.2.7) diff --git a/fivetran/framework/core/model/connector_schema_config.go b/fivetran/framework/core/model/connector_schema_config.go index 149c4126..3f75bacc 100644 --- a/fivetran/framework/core/model/connector_schema_config.go +++ b/fivetran/framework/core/model/connector_schema_config.go @@ -490,7 +490,7 @@ func (d *ConnectorSchemaResourceModel) getSchemasRaw() []interface{} { if sm, ok := tMap["sync_mode"]; ok { table["sync_mode"] = sm } - if c, ok := tMap["tables"]; ok { + if c, ok := tMap["columns"]; ok { columns := []interface{}{} if rawColumns, ok := c.(map[string]interface{}); ok { for cName, ci := range rawColumns { diff --git a/fivetran/framework/provider.go b/fivetran/framework/provider.go index e0ca7a98..9607c4a8 100644 --- a/fivetran/framework/provider.go +++ b/fivetran/framework/provider.go @@ -17,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -const Version = "1.2.3" // Current provider version +const Version = "1.2.8" // Current provider version type fivetranProvider struct { mockClient httputils.HttpClient diff --git a/modules/connector/schema/schema_column.go b/modules/connector/schema/schema_column.go index 340043f4..93126a2e 100644 --- a/modules/connector/schema/schema_column.go +++ b/modules/connector/schema/schema_column.go @@ -135,7 +135,7 @@ func (c _column) toStateObject(sch string, local *_column, diag *diag.Diagnostic result[NAME] = c.name - if c.hashed != nil { + if local != nil && local.hashed != nil && c.hashed != nil { result[HASHED] = helpers.BoolToStr(*c.hashed) } return result, local != nil ||