Options

SCA seems to try and delete my database rather than update it.

I recently delivered a compiled nuget package from our build server (TFS 2015 with VSTS style build) to our QA department to update their test environment.   Per my previous discussion on this board, I directed them to start with an empty target database. They went though the following steps to deploy:
  1. $production = New-DatabaseConnection -ServerInstance "SERVERINSTANCE" -Database "DATABASENAME"
  2. $package ='PACKAGETITLE.nupkg'
  3. $build = Import-DatabaseBuildArtifact $package
  4. $release = New-DatabaseReleaseArtifact -Source $build -Target $production
  5. Use-DatabaseReleaseArtifact $release -DeployTo $production
After running through the steps, the analyst came back and informed me the database was still empty.   No schemas, tables, procs, functions or views had been deployed.

Working together, we modified our approach to check what was attempting to deploy:
  1. $production = New-DatabaseConnection -serverinstance SERVERINSTANCE -Database DATABASENAME
  2. Test-DatabaseConnection $production
  3. $file = 'PACKAGETITLE.nupkg'
  4. $build = Import-DatabaseBuildArtifact $file
  5. $release = New-DatabaseReleaseArtifact -Source $build -Target $production
  6. Export-DatabaseReleaseArtifact -InputObject $release -Path C:\temp\FOLDER -Force -Verbose
The result was that SCA thought there were no changes to deploy, despite the fact the database was empty.

I then compiled the project locally and generated the DATABASENAME-Package.sql file as well as the ps1 file.   We ran that script and the database was fully populated with tables, views, etc.   I repeated the steps above to export the database release artifact.    The update script created wanted to drop all tables, views, stored procedures, etc from my database.   It wanted to empty it out. 

What's going on?????
Tagged:

Answers

  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi @l570,

    Sorry you're running into this strange issue!

    It would be helpful to know what version of SCA you are using, and if possible, share the full log file and also the release artifact with us.

    We've opened a support ticket for you and I will follow up with you there.


    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


Sign In or Register to comment.