We have a requirement for which we want to have Red Gate Source Control as a part of the Automated Interface.
We would like to programatically Link the Required Database and do Commit for the Changes to the Database.
Is this possible? If yes, which api should we use?
I know this question is old but I'm doing exactly what you are describing.
I have a job that runs every X minutes and puts the current state of the database into version control (for us it's mercurial but you can achieve exactly the same thing with git or whatever).
cd c:\data\SourceCodeDirectory
hg pull
hg update
if not exist "c:\data\SourceCodeDirectory\databaseName" mkdir "c:\data\SourceCodeDirectory\databaseName"
cd "c:\Program Files (x86)\Red Gate\SQL Compare 11"
sqlcompare /s1:DBServer /db1:databaseName /scr2:"c:\data\SourceCodeDirectory\databaseName" /synchronize
cd c:\data\SourceCodeDirectory\databaseName
hg add
hg commit -m "Database Changes" -u DatabaseSchemaUser
hg push
Any changes made to the database will be in version control as soon as this job runs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With