Executing embedded migrations fails for included file
christianacca
Posts: 24 Bronze 1
Guys,
The DbUtil project that you're advising to use has multiple problems:
1. Executing embedded migration not using SQLCMD variables (see https://forums.red-gate.com/viewtopic.php?f=199&t=80411)
2. Included files with relative paths are not executed (this post)
It seems poor form to provide advice to your customers to use a tool, when you have not tested that tool thoroughly yourself.
I will submit a PR to the project for a fix, but it's disappointing to run into these issues and have to fix them myself.
Christian
The DbUtil project that you're advising to use has multiple problems:
1. Executing embedded migration not using SQLCMD variables (see https://forums.red-gate.com/viewtopic.php?f=199&t=80411)
2. Included files with relative paths are not executed (this post)
It seems poor form to provide advice to your customers to use a tool, when you have not tested that tool thoroughly yourself.
I will submit a PR to the project for a fix, but it's disappointing to run into these issues and have to fix them myself.
Christian
Comments
I'm sorry you're running into limitations with using ReadyRoll in conjunction with DbUtil. I agree that we should have communicated these limitations better to begin with, to reflect the fact that deployment via embedded resource is still in it's early stages. To make this clearer, I've added a new section to the documentation to capture these limitations in the tool. I've tried to enumerate all the limitations I could find.
https://documentation.red-gate.com/display/RR1/Embedded+Resource#EmbeddedResource-AddingtheSQLCMDrunner
With regard to the issue with including files, an alternative approach is to pass in a value for the DeployPath variable to help construct the absolute path, for example: And in the pre/post-deployment SQL script:
Product Manager
Redgate Software
The other workaround involves "uncommenting" the variables included in the migration script. By doing so this overwrite any variable assigned in advance to sqlRunner.Environment.Variable.
I have looked at the code in DbUtil and I think there is an obvious solution to the problem that can be applied. I hope to create a PR this afternoon.
Christian
Can you follow this up with the author of the DbUtil project?
Thanks
Christian
I'm attempting to get in touch with the project owner now.
Product Manager
Redgate Software
I'm just following up to confirm their publication on NuGet.org.
Product Manager
Redgate Software
Please let me know how you get on.
Product Manager
Redgate Software