Commit 4f0b312
authored
fix: Error if both PKs and PK components are set (#2113)
#### Summary
I spent too much time debugging a bug I had when I (meaning Cursor AI) auto complete `PrimaryKeyComponent: true` instead of `PrimaryKey: true` for me. Which means I had both PKs and PK components on the same table, causing `_cq_id` to only be calculated from the PK component, losing data when `pk_mode: cq-id-only` was enabled.
See cloudquery/cloudquery-private@ef8762e
This PR adds a validation to ensure only either ones are defined, or not defined at all. This has to happen after the `TransformTables` call since columns can be configured manually as well
---1 parent abd2117 commit 4f0b312
2 files changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments