How can we help you today? How can we help you today?
Kendra_Little
That makes sense, thank you for clarifying, @PeterDaniels ! Coincidentally, I met with members of the SCA team just this morning to chat about clarifying concepts around baselining in our docs. One of my questions was, "are there times when we do NOT want to create a baseline, and what are those exceptions?" The list of exceptions I have as of this moment is: New project / greenfield development, when there is no production and we're just starting by adding objects as we go. There's really nothing to baseline in this case. When learning the SCA product for the first time, it can make sense for people to work a little with the migrations scripts first and get a feel for things first sometimes before diving into baselining (simply because there is some complexity with establishing an initial-baseline, and it can make sense to start with more daily-task style things). You have an interesting case, because you're somewhat in the middle of "new" development and "existing database". There is no production yet, but you've already got activity that's been completed in an integration environment so you aren't at the "starting from scratch point" either. (Just reiterating this for readers as the context gets lost sometimes.) So, which to do? If you choose to create a baseline from the integration environment (set it as your "target" on the baseline wizard, use an empty db as "development" as you describe in your first post here), you should be able to deploy from that to an empty database. I just re-ran through that scenario with the PowerShell cmdlets (gist of my simple script here) and it worked -- it will deploy the baseline to the empty database, and then apply incremental migrations on top of that. In this case, in TargetedDeploymentScript.sql there will be a line like "----------------- BEGIN INCREMENTAL MIGRATION: "Migrations\1.0.0-Baseline\001_20190204-1330_kendar.sql" ------------------"  This will be followed by all the code from the baseline, then other migrations However, if the database you deploy to isn't totally empty --for example, if you create a user table in it (I created an empty one named "foo") -- that's when I wouldn't expect the deploy to work. SCA detects that the database isn't empty, so it doesn't want to lay down the migration script. Is it possible that this was the case in your initial testing? (The user objects in question could be getting sneakily created by accident by being in model, for example.) In this case, in TargetedDeploymentScript.sql, there will be a line like " PRINT '----- baselined: Migrations\1.0.0-Baseline\001_20190204-1330_kendar.sql (marked as deployed) -----';" The code for the baseline itself won't be in there. In my test, this caused the deployment to simply roll back when it hit errors, since I was using the default option to do it in a transaction If you do already have a lot of objects in the dev/integration environment, it might be useful to track down if this is failing in your case due to deployment target databases not being empty.  In that case, I'd personally like to create a baseline, because it seems like a quite convenient way to encapsulate your starting point. As long as when you deploy to dev/qa/uat they are truly empty databases (or I suppose they could be a restored copy of your integration database, just as long as you are 100% sure the baseline doesn't need to be deployed), that should work, from my testing. As to what exactly is happening behind the scenes differently in the MSBuild task, I am not sure on that account. I believe the release artifact functionality may be more recent and may not yet be integrated into all plugins. / comments
That makes sense, thank you for clarifying, @PeterDaniels !Coincidentally, I met with members of the SCA team just this morning to chat about clarifying concepts around baselining in our docs. One ...
0 votes
Hi Pete! I saw that you posted this in the SQL Server community slack channel as well, and I've responded there. No problem at all posting in both, just wanted to update you here that messages await you there [image] / comments
Hi Pete! I saw that you posted this in the SQL Server community slack channel as well, and I've responded there. No problem at all posting in both, just wanted to update you here that messages awai...
0 votes