Options

Undo a commit?

We have downloaded the Redgate Source Control and SQL Compare Pro trials.  We have a SQL Server environment and Subversion server (shared development model).  After installing the Redgate software, we linked a database to source control and were successful in doing so; including committing changes and viewing revision history.

Question:  during our tests, we created one Subversion repository with the idea of using just 1 SQL database during our source control tests.  One of our testers accidentally connected 2 SQL databases to the 1 Subversion repository and performed the initial commit.  We have noticed that our 1 repository now contains the mix of all objects from the 2 databases; including the history of commits for both databases shows in 1 screen.

It looks like we need to create 1 repository per database in order to keep things clear and separated.  However, is there any way to undo his commit of the 2nd database to the 1 repository?  If we can undo that initial commit, then at least the repository will be just for 1 database again.  I tried to undo the commit but I seem to have to use SQL Compare, which I’m afraid will not just remove the committed items but also run the SQL scripts to remove the actual objects in the 2nd database …

Tagged:

Comments

  • Options
    If you're using Subversion and you want to revert to a point in the past, then you need to use your Subversion tools to achieve this. If you're using TortoiseSVN, then an answer can be found here. This operation should be applied to a working folder. If you are using the native connectivity in SQL Source Control, then your best bet is to create a working folder in a temporary location on your PC by right clicking on the repo directory and using SVN Checkout (assuming you're using Tortoise), then follow the instructions in the link provided and do the revert. After the revert, check in the changes again and your repository should have gone back in time. You can now remove this temporary working folder.
    David Atkinson
    Product Manager
    Redgate Software
  • Options
    jornvangojornvango Posts: 16 New member
    What's confusing me is that we don't really want to go back to a point in the past.  We have 2 databases, both linked to the same SVN repository by using Redgate SQL Source Control.
    We have unlinked one of the 2 databases but those items are still showing up in the repository.  How do we get rid of them? (without affecting the actual database; we just want to clean up the repository as if the 2nd database was never linked)
  • Options
    If there are changes to the first database that you need to preserve, which I'm assuming is the case because you can't go back to a point in the past, then I'd suggest the following.

    1) Follow my instructions as described above.
    2) Load SQL Compare and put database 1 as the source and the reverted scripts folder from step 1 as the target
    3) Run a "deployment". This will fix any differences between "the point in the past" and database 1
    4) Commit the changes in your working folder back to the SVN repository
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.