URGENT: Nonsense error when saving migration script

shaulbehrshaulbehr Posts: 9
I've made a change to a table that added a non-null column. SQL Source Control correctly determined that this change should need a migration script.

So I click the "Add a migration script" link, which pops up the uncommitted changes, correctly listing my modified table.

I then click "Create and Edit Script..." which generates a default migration script. I delete this script and replace it with my migration script. Then I click "Proceed to Commit...". I get a confirmation "Save migration script?", which has by default names the script "Latest to Next (Created at {d-M-yy HH-mm-ss}).sql". To demonstrate a point, I click "save", and save the script in "C:\Temp\Foo.sql".

BANG! SQL Source Control throws an error:
The specified script path C:\Users\Shaul\AppData\Local\Red Gate\SQL Source Control 3\MigrationsFolderLiveInstances\mtnapoij.thj\Latest to Next (Created At 18-7-12 15-59-40).sql does not end with .sql.

Aside from the fact that the error is nonsense (the given file name clearly does end with ".sql"), that's not even the file name or path I'm saving to! And I'm not even doing anything particularly out of the ordinary!

I cannot get past this error, and therefore cannot commit my changes to source control. This is a showstopper. Please can you help, urgently?

My version of SQL Source Control: 3.0.13.4214

Comments

  • Sheesh, the error suddenly went away, seemingly of its own accord.

    The only thing that changed was, in yet another attempt to reproduce the error, I had, for the first time, *not* closed the "Migration script" window in SSMS, so when I clicked on "add a migration script", it warned me that I was about to discard my changes to the previous script. I said fine, discard, it regenerated the script, I pasted my script back into the window, clicked "Proceed to commit", and this time, instead of getting me to save the script file, it proceeded back to the "Commit Changes" panel, with my new migration script now listed in the changes to be committed.

    But a new problem has now arisen: I checked in my changes, but on another computer, when getting latest, the migration script is nowhere to be found. So it tries to add the not null column with a default script, which of course fails.
    Where did my migration script go??
  • On the second computer, does this have migrations enabled in the setup tab? It's possible that this is linked but without having specified the migrations folder.

    You can check this in the setup tab as well as just clicking on the migrations tab to see if anything is listed.

    David Atkinson
    Red Gate
    David Atkinson
    Product Manager
    Redgate Software
  • On the second computer, does this have migrations enabled in the setup tab? It's possible that this is linked but without having specified the migrations folder.

    You can check this in the setup tab as well as just clicking on the migrations tab to see if anything is listed.

    David Atkinson
    Red Gate
    Hi David,
    Thanks for pointing this out - yes, you are correct: the 2nd machine did not have the migration folder set up.

    But the original problem still stands. I still cannot create any migration scripts on the first computer. Looks like it was sheer dumb luck that got it to commit that once. I just created a test table on my 1st computer, checked it in, updated on the 2nd computer. Then I added a not nullable column to the 1st computer with a migration script, and I cannot commit the script to source control. Same rubbish error as before.

    There has to be a secret switch somewhere, because it's inconceivable that the product is generically defective in this area. But the fact is, I haven't done anything fancy with my installation, and out of the box, this feature does not work.

    Just to be sure, I switched computers and added the migration script from Computer 2. Exactly the same stupid error.

    What now?
  • I realized I recently upgraded my DB from SQL 2008 R2 to 2012, and thought maybe the problem is because I was still using SSMS 2008. So I opened SSMS 2012, and went through the same steps of adding a migration script. Now instead of raising that rubbish error, it crashes the whole SSMS.
  • Ah - this info helps.

    Can you upgrade or uninstall your copy of SQL Test? We discovered an interoperability issue with this and pushed out an update. Try adding a migration script once the update is installed an report back to us.

    Apologies for this issue. We put out a release fairly quickly once we discovered it but maybe you were one of the few who installed it in the interim.

    David
    David Atkinson
    Product Manager
    Redgate Software
  • Yep, that was the problem.
    Uninstalled and reinstalled SQL Test, now everything is working fine.
    Thank you very much!
Sign In or Register to comment.