SQL Change Automation trying to add PK constraint that already exists
We had an issue today where the script generated by SQL Change Automation included a Unique Primary Key constraint that already existed on the Target Database, which would fail the deployment because the Primary Key already existed.
We took out the offending statement, and ran the script and did another compare (deploy) afterwards and the error went away as it didn't generate the script to try to add the existing PK constraint again...
The generated html of the changes before deploying did not show this table being modified as well, it just snuck the change in there for some reason, any manual compare wouldn't show the change either.
What could have been the problem?
Error from Octopus Deploy Attached: