Archiving Migration scripts

We have been using SQL Source control for about 6 months now so i have a lot of Migration scripts we have created. A good percentage of those have gone to production and are no longer needed. I notice that when doing the SQL compare it still looks at all scripts even those we did months ago.

So my question is what do most of you do to archive these? do you just delete the old ones out manually? when i go to SQL source Control and look at old scripts there is no option for delete on old ones just view\edit. What have you found is the best practice for getting rid of the old ones?


  • Sergio RSergio R Posts: 610 Rose Gold 5

    We don't recommend removing them since if you need to deploy to a blank DB you should have all of them.
    If you want to delete them, then you would have to start from the most recent script.
    You can the recreate scripts for past revisions using the technique outlined in the following document:

    Thank you,
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Is this still considered a valid answer?  I have a migration script from last year that references a field that no longer exists.  When I go to apply to an empty database (or a full one from a database restore, say from production) I can't because the old migration script will always fail.  To fix it, I had to check out the repository to a normal folder, delete the offending script and alter the json file that determines the patch order so that entry is no longer there.  I committed then went back to SSMS, refreshed on the "Get Latest" tab and found the script wasn't there anymore.  After that, the update worked.
Sign In or Register to comment.