Comments
9 comments
-
I was able to get this to work with the exception of Migration Scripts. My scenario was similar, but using Bamboo instead of Team City.
Basically this:
Bamboo:
- Monitor Git for changes
- Get latest source for branch
- Build database (validate) and create NuGet package
- Push to Octopus
- Create a release in Octopus
Octopus:
- Install package
- Redgate - Create Database Release (step template imported into step template library)
- Redgate - Deploy from Database Release (another step template imported in)
- Notify
Everything works fine from the schema and populate with static data, but the migration script I added doesn't get executed.
It seems there have been some changes in V5 since V4 (below is in the V4 documentation):The current migrations feature isn't compatible with distributed version control systems like Git. However, SQL Source Control 5, add support for Git, as well as branching and merging.
Download the SQL Source Control 5
Scripts created using a previous beta version of migrations won't be compatible with SQL Source Control 5. To learn more, see Upgrading from old versions of migration scripts.
I'm using Git so it sounds like it isn't supported, which is fine so I upgraded to V5. But then I found some information that seems to point it not being supported with the DLM automation tools (although it was in V4 by passing SQL Compare options, UseMigrationsV2):Deploying migration scripts
SQL Compare 11 or later can generate deployment scripts with migrations using the following source/target types:
We recommend using SQL Compare to deploy changes to production, as you have the opportunity to review the deployment script before it's deployed. For a full walkthrough of the deployment process using SQL Compare, see Migration script examples.
It is possible to use the Get latest function in SQL Source Control to deploy these changes, however we don't recommend linking your production database directly to source control.
So it's saying you need to use "SQL Compare 11 or later" to generate deployment scripts with migrations. That to me implies that it can't be done with the DLM tools that are used by Octopus.
Maybe someone at RedGate could confirm this?
Thanks,
Dave -
I am in the same boat as davej.
I am using TeamCity.
Was using SQL Source Control 4 with passing SQL Compare options, UseMigrationsV2. Which worked with TeamCity.
I have now upgraded to SQL Source Control 5.
Now in TeamCity the schema changes deploy just fine but my migration scripts do not run.
Can any Redgate Representative offer help with this?
Thanks -
I have discovered that redgate has replaced the SQL Automation Pack with DLM Automation, which is available in the SQL Toolbelt.
For more details, see Redgate's DLM Automation page.(http://www.red-gate.com/dlmautomation/).
This is required for migration scripts to work in the latest version of SQL Source Control (5).
I haven't upgraded yet, once we have and I have tested and verified migration scripts are working I will update this page with that info.
Thanks -
They changed the way migration scripts worked a while back. I'd make sure the migration script you created (that isn't working) was created in the right version with respect to the release of DLM you're using.
-
Did you ever get this working with migration scripts as I am having a similar issue?
-
Hi RickD43,
You can use migration scripts with DLM Automation, however bear in mind that DLM Automation 2 will only work with scripts compatible with SQL Source Control 5 and newer. DLM Automation 1 works only with migration scripts compatible with SQL Source Control 4 or older.
Thank you, -
Sergio, I am using DLM Automation 2 and SQL Source Control 6.0.2.6908 and all migration scripts were created by this or the previous version, which was 5. Still having the same issues.
-
Hi RickD43,
That should work, if your license is supported, can you please log a support ticket so that we can check exactly what's the problem in your case?
You can either go to Customer portal at the Redgate webpage or email us at support@red-gate.com
Thank you,
-
I do not have a support contract. Starting to give up hope of ever getting to a DevOps position as can't find any decent resources for your software except here and this isn't the most helpful.
I have found that if I create a build database on a server (and not use Local DB), then point DLM to that, it works (even though I still get exit code 79 in SQL Compare). This isn't really the way I want to do builds and when I was doing a POC on my local machine, this problem didn't exist, but if there is no other way, I guess I will have to create a new instance of SQL just for this.
Add comment
Please sign in to leave a comment.
Everything is working fine until the Octopus Deploy part where I can't really deploy the database changes/migration scripts.
I'm following the steps on documentation as highlighted here:
http://documentation.red-gate.com/displ ... +templates
In my Octopus Deploy, the steps all run fine, but my Changes.html has the following script:
And when I run the Octopus Deploy steps, I get the following log for Redgate - Create Database Release step:
Then I get the following log for the Redgate - Deploy from Database Release step:
The step completes successfully, but nothing happens in the target database. I've tried with different scripts, always scripts that either insert data or change data in the target database.
Nothing works.
Can you see anything obvious that I'm missing?
Any help will be much appreciated.
Regards,
Pedro Silva