Checksum warnings - "this migration has changed since it was deployed"
PeterDaniels
Posts: 89 Bronze 3
I'm seeing a ton of warnings in the output for New-DatabaseReleaseArtifact that say:
"WARNING: C:\[...]\AppData\Local\Temp\DLM Automation\ifp4iatf.30a\Migrations\1.1.0-Changes\014_20190314-1432_[...].sql: This migration has changed since it was deployed to [localhost]. [TestSCA_QA]. These changes will not be applied to the target unless the database is dropped/redeployed."
I haven't modified any of these migrations. Only thing I can think of is perhaps my git/github settings are off and maybe it added/removed newline characters during a pull.
How can I get SCA to not warn about these anymore...or get the right checksum into the migration log...or otherwise resolve?
TIA,
-Peter
"WARNING: C:\[...]\AppData\Local\Temp\DLM Automation\ifp4iatf.30a\Migrations\1.1.0-Changes\014_20190314-1432_[...].sql: This migration has changed since it was deployed to [localhost]. [TestSCA_QA]. These changes will not be applied to the target unless the database is dropped/redeployed."
I haven't modified any of these migrations. Only thing I can think of is perhaps my git/github settings are off and maybe it added/removed newline characters during a pull.
How can I get SCA to not warn about these anymore...or get the right checksum into the migration log...or otherwise resolve?
TIA,
-Peter
Tagged:
Answers
setting in the sqlproj file? Or something different?
The checksum generated is a SHA256 representation of the migration script at the time of the build. This value is used to determine whether a migration has been changed since it was last deployed. In the case of a programmable object script, a different checksum will cause the migration to be redeployed.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
E0F10404E1FDCBBEF178991783B426B5FCF4BA2A906DDF75CFB54DF025721EDB
but using Get-FileHash -Algorithm SHA256 gives me:
222A98897E8773854BED4584B70176BA74188E5EA1D28A8ADE8DB1E1A2B59941
I've also checked my git history and none of my migrations that SCA was warning about has changed.
I was under the impression that as long as there was an entry in the migration_id column that matched the id shown in the migration itself (and possibly the checksum to make sure the script hasn't been modified since it was deployed), that it wouldn't attempt to be deployed.
Doing a trial of this, the entry in the database I deployed to is the same except for the complete_dt column value and the deployed value (being 1 instead of 2 since it was deployed to the target, but imported to the dev database).
If I then delete the _MigrationLog table doing the deployment fails because target needs to be baselined.
Recreating the _MigrationLog table with the same values as are in the development database (but changing it to deployed 1 instead of 2) - I used SQL Compare to recreate the schema for _MigratinoLog and Data Compare to create a script to deploy the data (which I then changed the 2 to a 1 for the migration) - after building again, it then worked as there was nothing to deploy.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com