The way deployment scripts are ordered schemas are created before roles, so in the case of the above the following error will occur:
- Code: Select all
 Cannot find the user 'TEST_SCHEMA', because it does not exist or you do not have permission.
CREATE SCHEMA failed due to previous errors.
The following SQL command caused the error:
CREATE SCHEMA [TEST_SCHEMA]
This is obviously because your role hasn't yet had the chance to be deployed and hence your script will fail. Editing the script manually to create the role before said schema will allow the deployment through without fault.
Can the developers please check for schemas owned by roles and rearrange how the deployment scripts are created for these cases?