SC not recognising "release candidate" migration scripts

MckMurrayMckMurray Posts: 37 Bronze 3
edited September 23, 2016 10:06AM in SQL Compare 11
I've downloaded the SQL Source Control 5 release candidate and have saved a data-only migration script.

So far, branching and merging looks promising: I was able to checkin my script to the dev branch, merge up to QA, and then I can see the migration script in the Get Latest source control tab for my QA database. (I did not actually perform a "get latest")

However, I'm having no such luck with deploying said migration script with SQL Compare. It does not recognise or find any migration scripts during the deployment process.

My databases are linked to scripts folders, and I'm trying to deploy from the Dev scripts folder to QA database using SQL Compare 11.6

What am I missing?

Comments

  • Hi,

    SQL Compare doesn't show migrations scripts yet, but does deploy them. If your only change to deploy is a data-only migration then you won't see any differences when you compare the databases, however the "Deployment Wizard" button should still be enabled. Clicking the deployment wizard button will generate your deployment script, which will contain your data-only migration.

    Let me know if this isn't working.

    Best wishes,
    Tom Smith
    Software Engineer
    pBX6I2Z.png
  • MckMurrayMckMurray Posts: 37 Bronze 3
    Ah, good to know. However the next challenge seems to be the following error when it tries to generate the deployment script:

    Cannot apply: HunkHeader[179,7->179,9]

    Any ideas? Thanks
  • Can you confirm which version of SQL Compare you're using?
    Development Lead
    Redgate Software
  • MckMurrayMckMurray Posts: 37 Bronze 3
    Version 11.6.1.1686 Professional
  • Ok, thanks. That shouldn't be happening, so we'll need to investigate it with you. We'll need a copy of your scripts folder, and ideally a backup of your database. Could you email [email protected] with details so we can start understanding what's going on?
    Development Lead
    Redgate Software
  • I've been experiencing the same issue, our setup is as follows:

    SQL Source Control 5.1.1.2694
    SQL Compare 11.6.3.1926
    TFS 2015 source control

    We have just moved over to SOC v5 and on the first attempt to deploy changes (including three new v5-style migration scripts DDL - DML - DDL), SQL Compare did not find any migration scripts and, more to the point, the resulting deployment scripts did NOT include them either. These were the things I checked/tried:

    1) Check that the value for "SQLSourceControl Database Revision" in the target database was less than the earliest change set number of any expected migration script
    2) Check that the value for "SQLSourceControl Scripts Location" was pointing to the correct URL for our TFS repo
    3) Check that there was no extended property called "SQLSourceControl Migration Scripts Location"
    4) Reconnected SQL Compare to the correct source folder location in TFS

    This was the first time that we had tried deploying changes with the new v5 migrations so [RedGateLocal].[DeploymentMetadata] did not yet exist in the target database.

    All to no avail - still no migration scripts.

    Possible Fix: Finally, I found the behaviour option "Ignore migration scripts for databases", This was unchecked. On a "running out of ideas, pulling my hair out" hunch I tried checking this option, saving the project closing and re-opening SQL Compare then unchecking that option again. It may have been simple coincidence rather than my hunch but the next time I tried building a deployment script, the expected migration scripts were included in the final script (although still not visible in the pre-deploy steps).

    I think that the change to SOC v5 migrations is a really good thing but I am really disappointed to discover that I have to dig around in a forum to discover that SQL Compare will (eventually) include those new-style migration scripts even though it tells me there are none. I accept that SQL Compare may not yet be able to list the individual migrations or the objects they affect (the way it did for v1) but it should still indicate to the user that such scripts will still be included in the final deployment script. As it is right now, when building a deployment script, in the Deploy dialog, in the list of steps we see ""2. Review Migration Scripts > No migration scripts". This is really misleading and I have come to expect better from Red-Gate.

    When will support for SOC v5 migrations be fully implemented for SQL Compare and in the meantime can we have a frequent updates release that at least highlights the fact that migrations are not listed but will be included in the final script?

    Many thanks for an otherwise great product range.
    "Your mind is like a parachute, it works best when open" Frank Zappa
    "Be wary of strong drink. It can make you shoot at tax collectors…and miss" Robert Heinlein
    blog: http://datacentricity.net
    twitter: @datacentricity
  • sheldonhullsheldonhull Posts: 35 Silver 1
    I'd love to see an updated response on this. I'm working through SSC 5 as possible replacement in our process here, and would like to know the answer. I'm having trouble identifying the deployment metadata and digging around to find out revision number info etc.

    Any updates?
  • Even I have seen an Error like "Error: Comparison of '.' and '.' failed: Cannot apply: HunkHeader[1,113->1,118]".

    This is cause when a migration script was added to my database. If I exclude the script from deploymentorder.json and commit it to my source control I can build a script using SQL compare. Can anyone from redgate tell us what are the possible causes for migration scripts getting messed up that SQL compare throws such a vague error. Or is this a bug in SQL compare?
    Roger
  • I have also faced an issue where in migration scripts cannot be added to the deployment script.
    SQL compare throws up an error "Error: Comparison of '.' and '.' failed: Cannot apply: HunkHeader[1,113->1,118]".
    Not sure how this was caused, but would like to know the probable cause when these migration scripts go bad.

    Once I excluded the migration script in the DeploymentOrder.json I was able to generate a SQL deployment script using SQL Comapre without migration script.

    Update: Also upgraded to the latest & greatest of SQL compare & SQL Source Control but still the problem persists.
    Roger
Sign In or Register to comment.