diff --git a/schema/table.go b/schema/table.go index c523fb9a4e..cb21e5b3e5 100644 --- a/schema/table.go +++ b/schema/table.go @@ -102,6 +102,9 @@ type Table struct { // This relates to the CloudQuery plugin itself, and should not be confused // with whether the table makes use of a paid API or not. IsPaid bool `json:"is_paid"` + + // IgnorePKComponentsMismatchValidation is a flag that indicates if the table should skip validating usage of both primary key components and primary keys + IgnorePKComponentsMismatchValidation bool `json:"ignore_pk_components_mismatch_validation"` } var ( diff --git a/transformers/tables.go b/transformers/tables.go index 5fb33a9a89..4322b72f5e 100644 --- a/transformers/tables.go +++ b/transformers/tables.go @@ -26,7 +26,7 @@ func TransformTables(tables schema.Tables) error { if err := TransformTables(table.Relations); err != nil { return err } - if len(table.PrimaryKeys()) > 0 && len(table.PrimaryKeyComponents()) > 0 { + if !table.IgnorePKComponentsMismatchValidation && len(table.PrimaryKeys()) > 0 && len(table.PrimaryKeyComponents()) > 0 { return fmt.Errorf("primary keys and primary key components cannot both be set for table %q", table.Name) } }