cli/cmd/sync_v2.go: WithRemovePKs() called twice instead of WithRemovePKs() + WithRemoveUniqueConstraints()
Author: praneshnikharCreated Jul 27, 2026Updated Jul 27, 2026
CLI: Wrong transformer option in cli/cmd/sync_v2.go
File: cli/cmd/sync_v2.go:34
Problem: In the v2→v3 append-mode path, WithRemovePKs() is called twice instead of WithRemovePKs() + WithRemoveUniqueConstraints(). This means unique constraints are silently preserved when they should be removed to match v3's schema expectations.
Current code:
opts = append(opts, transformer.WithRemovePKs(), transformer.WithRemovePKs())Expected:
opts = append(opts, transformer.WithRemovePKs())
opts = append(opts, transformer.WithRemoveUniqueConstraints())Fix: Replace the duplicate WithRemovePKs() call with WithRemoveUniqueConstraints().
Reproduction
- Configure a v2 source plugin with a v3 destination in append mode (via
v2-to-v3migration path). - Run sync — unique constraints from v2 tables are preserved in the destination.
- These constraints can cause conflicts/errors on subsequent writes since v3 destinations don't expect them.
Source: cloudquery/cloudquery