Hi. Really new in Redgate.
My command wants to automate generating redgate scripts.
Basically when a developer makes a commit that requires DB changes he/she runs SQL Compare Pro (from SSMS) that generates scripts
Source: SQL source control, revision some_revision_needed Target: SQL source control, revision HEADWe use TFS as a version control system.
Now I'm trying to figure out how to make the same happens from PowerShell.
Reading
this article, got the scripts from Github
but can't understand what is this (in the script code):
$Source = '1'; $Target = '2' #never alter these, they are constants.
if ($SourceType -eq 'Database')
{ $Dbs = $Source }
else { $Dbs = $Target } #the database (Dbs) is either $source or $Target. As far as I can see it in my case
both source and target will be DBs but different revisions.smth like
sqlcompare /db1:DB_DATA /revision1:bc1e57e /db2:DB_DATA /revision2:fd4e53a /scripts -please_put_the_scripts_here_and_don't_run_them_yetAm I wrong? Do I misunderstand the logic of Redgate work?
upd:
Probably it's not even comparing two DBs but two SQL source controls...
There is a piece of the internal manual for developers to do it manually. That's how it works now.
So what my line to run the script should look like?
My command wants to automate generating redgate scripts.
Basically when a developer makes a commit that requires DB changes he/she runs SQL Compare Pro (from SSMS) that generates scripts
Source:
SQL source control, revision some_revision_needed
Target:
SQL source control, revision HEAD
We use TFS as a version control system.
Now I'm trying to figure out how to make the same happens from PowerShell.
Reading this article, got the scripts from Github
but can't understand what is this (in the script code):
$Source = '1'; $Target = '2' #never alter these, they are constants.
if ($SourceType -eq 'Database')
{ $Dbs = $Source }
else { $Dbs = $Target } #the database (Dbs) is either $source or $Target.
As far as I can see it in my case both source and target will be DBs but different revisions.
smth like
sqlcompare /db1:DB_DATA /revision1:bc1e57e /db2:DB_DATA /revision2:fd4e53a /scripts -please_put_the_scripts_here_and_don't_run_them_yet