Deployment script ordering of objects
brendan_t
Posts: 4
Hi
When generating a deployment script after doing a schema comparison, the ordering of the objects that are being created/modified isn't always consistent. That makes it difficult when using a text comparison tool to identify incremental differences between deployment scripts.
It would be nice if given the same set of differences, we could expect to get the exact result in a deployment script. This doesn't seem to be the case at the moment. Is there a setting I am missing, or any way to ensure objects appear in the same order in separate comparisons?
Thanks
Brendan
When generating a deployment script after doing a schema comparison, the ordering of the objects that are being created/modified isn't always consistent. That makes it difficult when using a text comparison tool to identify incremental differences between deployment scripts.
It would be nice if given the same set of differences, we could expect to get the exact result in a deployment script. This doesn't seem to be the case at the moment. Is there a setting I am missing, or any way to ensure objects appear in the same order in separate comparisons?
Thanks
Brendan
Tagged:
Comments
Is the script that's being generated in a different order still functionally correct, or does are the scripts invalid every so often?
The script is still functionally correct and can be executed successfully. Its more of a source control traceability issue. Unfortunately we do not have personal databases dedicated to a certain project or piece of work, so when we produce schema comparisons, we often only want to include a subset of the changes in the deployment script. Being able to then compare the deployment script with a previous deployment to ensure we have only captured the changes we want is important. It makes it difficult when objects appear in different parts of the script and are identified as differences by text comparison tools.
I assume there is a degree of ordering implemented to ensure dependencies are applied in the correct order etc. Apart from that, the ordering seems arbitrary as sometimes it is the same as previously, but not always. I thought it might be simple enough to add additional ordering criteria to ensure a specific order is retained each time.
cheers
Brendan
I have further explanation from a colleague in the Development Team.
The order that objects in the deployment script appear can be dependent on the order that the database gave them to us in the first place. So when Schema Compare for Oracle queries the system tables, the objects are listed in whatever order the database decides to pass us the information to Schema Compare. That order can change as the database manages its system tables.
When creating the Deployment Script, the dependency order is the most important criteria. The fact that Table_B gets created before Table_A but on the next occasion you create a deployment script, Table_A is created before Table_B is immaterial, it is the dependency order that is important and that the deployment script or when run is successful.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Yes I understand, and I suspected that is what was occurring. Perhaps you could consider adding extra ordering criteria to the system table queries for future releases? That would improve the usefulness of this tool a great deal in my case, and hopefully for others too.
Thanks for the response
Brendan
Product Manager
Redgate Software