fix(postgres): Error on new PK column#6749
Conversation
yevgenypats
left a comment
There was a problem hiding this comment.
The change looks good but before we do that I think we might want to introduce the --force on the SDK/destination plugin level as we do change PKs quite a lot and most of the time I think it worked so I would worry of adding a blocker without introducing the easy workaround that most people basically use now by default?
Sure. There's some refactoring needed to do before that as we'll need to show users all the changes that need "forcing" (currently we error out only on the first one). |
|
I'll merge this after we add force migration support like we did in SQLite #6763 |
|
Going to close this and do it once I add |
Summary
Related to #6600.
This changes the Postgres migration logic to fail when a new column is added and it's a PK.
This is the same as the SQLite plugin:
cloudquery/plugins/destination/sqlite/client/migrate.go
Line 93 in bfd1494
I think we can improve this as only error if the table exists and is not empty as for empty tables this shouldn't be an issue