Deploy from RG Source Control: Don't want to drop objects
JTR
Posts: 5 New member
Hi,
when deploying from build artifact, is it possible to prevent dropping objects which don't exist on the source?
Something like /exclude:Additional in SQL compare command line.
when deploying from build artifact, is it possible to prevent dropping objects which don't exist on the source?
Something like /exclude:Additional in SQL compare command line.
Tagged:
Best Answer
-
Kendra_Little Posts: 139 Gold 3Hi JTR,
Have you checked out New-DatabaseReleaseArtifact and Use-DatabaseReleaseArtifact?
New-DatabaseReleaseArtifact has an -IgnoreAdditional option which sounds possibly like what you're looking for, the description is:Specifies whether to ignore additional objects in the target database. Enabling this prevents new and unexpected objects in the target being dropped - note that the checks and tests applied to this database may not have taken those objects into account and may therefore not be valid.
This parameter can't be used simultaneously with filter files.If you know what the objects are that you'd like to skip, personally I'd test using -FilterPath on New-DatabaseReleaseArtifact to specify a filter file of what to ignore first, it seems cleaner to me.
The great thing about these cmdlets is that you can export and review the database release artifact to make sure it's doing exactly what you want before using it anywhere. Very nice when it comes to testing which option is right for you.
Kendra
Answers
I'm currently trying with TFS task (RG Change Automation - Deploy changes from build artifact) and -IgnoreAdditional parameter is not exposed in UI. But I'll switch to using powershell cmdlets it this is the only way.
I want to prevent dropping because often someone creates some temporary table(which are eventually dropped). For the known objects that shouldn't be deployed, I already tried filters and it works fine.
Thanks for help,
Janez
And yep, it's either filters or ignore additional.