How can we help you today? How can we help you today?

Source Control without the need to commit (outside of GIT)

Hi all,

Firstly I should apologise as I am sure that this question will have been answered somewhere but I have looked and cannot find it!

I am currently trialing SQL Source Control - we really like it but already use a different GIT Client (Git Kraken) to manage our GIT workflow. What I am hoping to achieve is getting SQL Source Control to generate a list of objects to store in GIT automatically on the fly without the need to commit through the SQL Source Control interface. The folder that contains these definitions would then be in a GIT tracked folder (as well as out .NET development code) such meaning that whenever we made a code change that had both a .NET and SQL component these would be checked in simultaniously without the need to do one commit in SSMS and then a further one in Git Kraken.

The long term goal (and the reason why I am keen to make it one commit) is so we can start using Teamcity to autodeploy both .NET and SQL changes in one go. Currently it would be quite easy to end up checking in .NET changes while forgetting to first commit in SSMS and so database changes would fail (and break the release).

I was hoping I could do this from the "Link to a working folder" option but it seems that this still requires that you manually "commit" changes in order for the objects to be updated in GIT.....

Any advice on this would be very much appreciated! :)
Louis_RH
0

Comments

4 comments

  • Louis_RH

    but again is reliant on devs remembering to first "Commit" from Sql Source Control before commiting with a GIT client...


    Louis_RH
    0
  • AlexYates
    Using the "working folder" option is exactly what I would have suggested. It has been designed for precicely this use case.

    The button is renamed from "commit" to "save changes" if you use this option.
    AlexYates
    0
  • Louis_RH
    Hi Alex,

    That works pretty well but still requires a developer to remember to go into SQL Source Control and actually save the changes. Is there any way this can be automated (or potentially better still - save changes triggered programatically?)

    My concern is that the normal context of the development team is in Visual Studio and Git Kraken (the vast majority of the time the database structure will not change) so am just concerned that if this step is missed that the CI/CD will break due to the db not being updated.


    Louis_RH
    0
  • AlexYates
    It's not available out of the box - but it could probably be automated using some sort of DDL triger and the SQL Compare command line.

    That said, any automated solution like that fills me with dread. It feels particularly painful to support/maintain. Much easier to get into the habbit of saving changes in SQL Source Control (using the "working folder" option) and then using the prefered git tool to manage commits/pushes etc.
    AlexYates
    0

Add comment

Please sign in to leave a comment.