Different script being applied on deployment
A script that was generated in one of the initial releases had a table rebuild process because the identity seed and increments are different in source control than in production. I stopped that build from running in production and configured the release step to ignore the identity increment and seed values.
I triggered a new release in Octopus and this worked perfectly fine because the script in the artifacts no longer wants to rebuild the table.
I then pushed it on to production, but it then times out because it tried to drop the primary key of the table it wanted to rebuild in the previous discarded release.
I ended up deploying the script found in the second release's artifacts manually to the database which worked fine.
Even now if I generate a new release with no new database changes it comes up with a script with comment lines that says there are no changes. This is expected, but if I push the build through to production it then again times out trying to drop the primary key of the initial script that was generated a few releases back.
How is it that the automation is executing something completely different than the scrip in its artifacts?