Options

Octopus and Redgate - Deploy from Database Release Failure

spl_vaultspl_vault Posts: 2
edited February 20, 2017 9:44AM in DLM Automation
Hi All,
Somewhat new to the (DevOps) game and have been handed a TFS/Team City/Redgate platform to work on.

The first issue that we have is (but I believe that it apples to other projects as well) a database deployment to an existing DB (what I would term as a Merge only applying the updates).

The error that we are receiving is
Use-DlmDatabaseRelease :Pre-Update schema check failed: The schema in the Database Release object (created at <DTG>) and database 'db_name' on server 'servername' are different, or static data is different.
At C:Octopus......script.ps1:59 char:1
+Use-DlmDatabaseRelease $DlmImport -DeployTo $databaseConnection -SkipPostUpdateS...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo           : InvalidResult : (:) [Use-DlmDatabaseRelease], TerminatingException
  + FullyQualifiedErrorId : SchemasAndStaticDataAreNotIdentical,RedGate.SQLRelease.Powershell.Commands.UseDlmDatabaseReleaseCommand

I have tried the different options with the Use-DlmDatabaseRelease (-Skippre and -skippost in various combinations) with errors being generated no matter what I do.

I have however been able to get the following to run in a separate Powershell
$dbcon = New-DlmDatabaseConnection -ServerInstance 'Servername' -Database 'db_name'
$package = 'D:OctopusPackagesdb_name.databasedb_name.Database.10267.146.nupkg'
$release = New-DlmDatabaseRelease -Target $dbcon -Source $package
Sync-DlmDatabaseSchema -Source $release.Source - Target $dbcon

I make a change on the target data in a table that is linked to static data - run the above script - then check the target and the data has been corrected - so it works

However, why doesn't the Use-dlmdatabaserelease commandlet work?

A colleague has said there was something about binary columns (and there is a varbinary in the schema) causing the compare to fail but I am unable to find any reference to this.

I have also run other tests -

Once the databases have been synced - running the Octopus deploy for the project generates no errors - reporting that there are no changes to deploy. However - on changing a single field (non-key) value and then try to do a deploy again and we receive the error above
Thanks in advance for any help given

Steve

PS - The platform I am working on has no Internet connectivity so getting any logs in and out will be extremely laborious

Comments

Sign In or Register to comment.