Integration with SQL Refactor/SQL Prompt's "Smart Rename"
Integration with SQL Refactor is crucial. Smart Rename should be noted by SQL Source Control and a commit should do a rename on the object in SVN to keep commit comments.
![](https://secure.gravatar.com/avatar/ff410a6faffe3926bdd635ae49b9f1ff?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
SQL Source Control 3.0 is now available!
It includes a new feature called ‘Migrations’ that will help avoid data loss when renaming a table as it allows you to create, store and share SQL change scripts for accurate deployment.
For more information about Migrations, please visit:
http://www.red-gate.com/supportcenter/Content/SQL_Source_Control/help/3.0/SSC_Working_With_Migrations
-
Yes, ideally we should be auto-detecting the rename and and going an svn move under the hood to preserve the history chain. It's something that we'd like to do, but I can't give you a precise date on when this might make it into the product.
-
Benny Bech commented
Migration scripts only solves the DB side of the problem, the Versioncontrol loses history during this. There is NO connection between the old name and the new name in the history (i'm using SVN but the problem must be the same for all Version Control systems).
The problem is even bigger on stored procs (no need for migration script).
I've tried renename the stored procs SQL script name in SVN, but the SourceControl (3.0) dosn't detect any changes (propoply because the name ISN't changed in the script) -
An Early Access build of SQL Source Control 3.0 is available which includes a new feature called "SQL Migrations".
This feature will help avoid data loss when renaming a table as it allows you to create, store and share SQL migration scripts for accurate deployment.
So when a table rename is identified as a table drop and create by SQL Source Control, you can override this behaviour by creating a bespoke script to cover these changes (using sp_rename to avoid any data loss). Your bespoke script will then be used by other developers when they invoke 'Get Latest' in SQL Source Control and will also be used during deployment via SQL Compare.
The installer zip can be found here:
https://www.surveymk.com/s/SqlSourceControl_DownloadAs I said, this is an Early Acces build - so does not include all the functionality we are hoping to provide with "SQL Migrations". We'd love to hear feedback from you regarding whether this feature provides a good solution to the problem you've described.