How are programmable objects ordered among themself to be deployed?

ducmanducman Posts: 26 Bronze 2
I understand that programmable objects are deployed at the very end. My question is related to just programmable objects and their deployment order among themselves (view first, then function, then procedure, etc.). It seem readyroll order the programmable objects during baseline creation. Does it do any ordering of new programmable objects that's added after baseline?

We are running into any issue where readyroll is deploying a function first then a view and the function is dependent on the view. In sql, you can create a function even if that view doesn't exist yet (get a warning). Which is why readyroll deploy the function first and the view second. But if a couple of days passes and the view and function are modified to query back a new column. The deployment of creating that function would error out because the view now exists but the new column it's looking for doesn't exist on that view because that view is being deployed AFTER the function.

I know we can manually change the ordering in the project settings (via drag and drop) but I was wondering why readyroll isn't detecting this dependency and re-order the deployment to do the view first then the function? Is it that after baseline creation, it's up to the developer to order new programmable objects?

Thank you
Tagged:

Answers

  • dnlnlndnlnln Posts: 234 Gold 2
    edited June 1, 2018 3:42AM
    Unfortunately this is a limitation in the way that the deployment order is currently set by the product: the order of dependency is only calculated when the project property is initially stored in the project file.

    As a workaround, the resetting of the order can be manually triggered as follows:
    1. Right-click the project in the Solution Explorer and select Unload Project, and then Edit <ProjectName>.sqlproj
    2. Find and delete the DeployChangesExecutionOrder element and its contents
    3. Save and then right-click the project and select Reload Project 
    When you next import a programmable object (or alternatively, click the Import all Programmable Objects button in the project designer), the order will be set again by ReadyRoll.
    Daniel Nolan
    Product Manager
    Redgate Software
Sign In or Register to comment.