Link static data: Only pick several rows to have under source control

I want to automate our DB deployment and have some question about best way to handle schema/data.

We have a development environment where all developers add their stuff to the centralized database (schema + data)
They need to commit their data to source control (git).

Question 1: Is it somehow possible to select static data rows to commit? Current solution is doing it by modifying the generated data script file in a text editor of choice which is error prone.

Later on, stuff is deployed to test environments. Several commits are selected and bundled. If now feature A is done, then feature B which adds more changes to the same table, but later only feature B is ready to deploy to next environments, stuff from feature A is included anyway (cherry-picking helps, but data separation is not always that easy)
I then thought about separating schema and data repositories.

Question 2: Is it somehow possible to link a DB to different repositories or is there any easy way to handle data differences on different environments? I read about the new pre-/post-deployment-scripting, but not all developers are DBAs, so this is a "No go" for us.
Tagged:

Best Answer

  • Eddie DEddie D Posts: 1,714 Rose Gold 5
    Hi , Thank you for your forum post.

    To answer question 1.  It is not possible within SQL Source Control to select the actual rows of data when linking the Static Data.  The choice available is to select the actual tables you wish to link to static data.  further information available here.

    To answer question 2.  If you use Git, Working Folder or custom version control system it is possible to switch branches, however the database you link to SQL Source Control can only connect to one branch at a time.  Further reading is available in this help article.

    Many Thanks
    Eddie
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
Sign In or Register to comment.