Powershell comandlet to Build dependant project(s)

Hi,
We have a situation where we would like build and deploy a database locally using SCA, the set-up is slightly more complex as it consists of a red-gate database project (project.ABC) that is dependant and references a second database project (Project.XYZ) both point to the same instance/database i.e. XYZ has objects and migrations that are a subset or prerequisite for project.ABC. There is a dependency set-up on the project.ABC as well as a database reference to pointing to Project.XYZ to use the same database.

We can deploy successfully locally using the SCA Visual Studio extension, which deploys both the projects in the order XYZ and then ABC. However we'd like to perform the same using the powershell commandlet's, and we are getting an error based on a schema that can't be found, that schema should be deployed from within Project.XYZ.

Is there a specific commandlet / set of commandlets to do this?

Answers

  • Sergio RSergio R Posts: 610 Rose Gold 5
    Hi,
    No, there isn't a specific cmdlet.
    It looks like this is failing on the schema validation step which is carried out by the Invoke-DatabaseBuild cmdlet, this cleans the database before the project's schema is validated and this looks to be the cause here.
    I will look into this further and will get back to you shortly.
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Sergio RSergio R Posts: 610 Rose Gold 5
    Hi,

    The best course of action here, would be to create the dependencies in the Pre-Deployment script for project ABC (so you should create the schema there). You would need to use code that guards against creating this schema when it is not needed (so you should do an existence check).
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
Sign In or Register to comment.