Deploying Baselined SCA project on an empty db using Azure DevOps pipeline

catalogdbcatalogdb Posts: 21 New member
edited March 3, 2020 12:01PM in SQL Change Automation
Hi,

I am breaking my head since morning to figure out why the baselined script is being marked as deployed despite the db is a fresh, absolutely empty db.

As a standard practice, we create Migration/0.0.0-Baseline folder which includes the baseline scripts for all our db projects which we have create sca project using prod db. However, we have created a fresh database which isn't deployed in projection nor there is any qa or uat environment.

So just as a standard practice, despite being a fresh db, I have checked "Enable baselining" option and moved the migration script that was generated by SCA into the Migration/0.0.0-Baseline folder. From my understanding, the baseline folder is not ignore or not skipped to deploy when we are deploying on a fresh database. Because the line#2 of this description says it.



I have even verified by deploying in empty test databases and it ran all the scripts including baseline script. I remember the VS output window has log something like "Considering as empty db".

However, when we created tried to run this using azure devops pipeline the log showing "marked as deployed" and skipping the baseline script. Why this is behaving differently on devlopment envrionment and differently on CD pipleline?

I was trying to explain DevOps that Baselining option will definatly run the baseline script if the description is correct. And my DevOps engineer says " SCA will NEVER EVER EVER run the baseline script, EVEN IF ITS EMPTY"

Who is correct?

My local envrionment:
I am using VS 2019 Enterprise edition. SCA 4.0 with Azure SQL

Not sure if the CD agent have anything to do with indifferent behavior.

Also, not sure if the test release/deployment done by DevOps has anything to do with this. DevOps engineer initially cloned a none empty db in qa (had only schema) and ran the pipeline. Which was successful which is expected. Now we went and cleaned up the db (dropped and created empty db) and failing at migrations scripts because the db is empty and sca had ignored the baseline script. 

Please help

Best Answer

  • DanCDanC Posts: 644 Gold 5
    Hi @catalogdb following on from our investigation on your support ticket, after all the confusion we had I think we established there was some lingering stuff in the database that was meant to be empty, and we confirmed it's working correctly. 

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

Sign In or Register to comment.