Comments
4 comments
-
It's not possible to use the SCA Project file as an input for the Sync-DatabaseSchema cmdlet
You need to add New-DatabaseBuildArtifact and then use its output as an input to the Sync-DatabaseSchema operation, for example:<div>$artifact = New-DatabaseBuildArtifact -InputObject $validatedProject -PackageId 99999 -PackageVersion 1.0.0</div><div><br></div><div><br></div><div>Sync-DatabaseSchema -Source $artifact -Target "Data Source=SQLServer;Initial Catalog=MyDB"</div>
-
Yes, that works. Thanks. Am I misunderstanding the documentation on the getting started page? The code snippet for "Syncing to a test database" does not identify the source of $validatedProject, but the only other reference is the snippet in "Validating the SQL Change Automation project" which is set from Invoke-DatabaseBuild.
https://documentation.red-gate.com/sca3/tutorials/getting-started-with-the-sql-change-automation-powershell-components
-
You understood it correctly, however that only works for SQL Source Control projects. Thanks for the feedback, I will get that corrected.
-
We have now corrected our documentation
Add comment
Please sign in to leave a comment.
on the last line of this powershell script which I lifted from the documentation.
What do I need to do different?