SQL Source Control Static Views (or Table Subsets using WHERE clause)
I would like the ability to source control a subset of a table (perhaps using a view).
I have inherited a database where lookup data is intermixed with user defined data. We reference the lookup data in the table using a code (VARCHAR) that is unique when another field is NULL, so it is possible to ensure that records are created/updated/deleted without concern for the primary key involved.
For more information, you can refer to this forum post:
http://www.red-gate.com/messageboard/viewtopic.php?p=50087
Hi,
We just added this capability to Flyway, which is our x-database, x-OS cloud- and Git-first Database DevOps solution for versioning and deploying database changes. You can learn more about this feature in Flyway at https://documentation.red-gate.com/fd/working-with-data-138347109.html#Workingwithdata-Controllingstaticdata.
You can also import your SQL Source Control repos into Flyway while keeping your Git history. Learn more about moving to Flyway and importing your project at https://documentation.red-gate.com/fd/transitioning-from-other-redgate-tools-164167855.html.
If you have any questions, please comment below or reach out to us at DatabaseDevOps@red-gate.com.
Thank you!
Stephanie Herr
Product Manager - Database DevOps
-
Timothy Bussmann
commented
We have a scenario where we have table maintenance screens in a user interface to allow the user to add/modify/delete lookup type values. As part of our application we provide a number of lookup values that are system defined and cannot be modified. We would like to be able to source control the system defined values, but also allow for user defined values to be unaffected. It does not make sense for us to use a separate table for the user defined lookup values because that would complicate the data schema and application design. It would help us a lot if we were able to source control static data that is filtered by a where clause (e.g. IsSystemDefined = 1 in our case).
-
Nate Suver
commented
This feature would be absolutely huge for us. We have a number of configuration tables that have a mix of default data and user defined data, having the ability to use ssc to manage this data right in the source repository would simplify our build configuration tremendously.
-
Kasper B
commented
Respecting a WHERE clause would eliminate the use of a view, so that is what I would prefer.
-
BarryK
commented
We just started using SQL Source Control 3 and it is a great feature. However the Link Static Data isn't much use without a where clause. We have numerous tables that contain both static and user data. Thanks for considering this feature.
-
Gabriele Ferreri
commented
We are actually using SQL Source Control 3 and it's important for us to be able to commit Static data using a where cause like in SQL Data Compare.
Please add this feature. -
Phil Helmer
commented
Is there any update on this? We are having to add a lot of steps to our process because this feature is missing. Granted, SDC can do the work, but now we are forking our work by tool (1 method for schema, 1 for data) instead of usage (1 method for the "always like this" items and another for the "where are we deploying it?" items).
-
Paul Jenkins
commented
I don't know of an orgranization that does not require audit columns on all of their lookup tables (static data). Not having the ability to do this makes the static data mechanism useless for organizations with auditing standards.
-
Corrin Lakeland commented
Hi, just wondering if anything happened with this now static data is live?
-
Jason Duffett
commented
The problem we have is that the current EAP builds of SQL Source Control aren't usable because of the limited data support.
We use the tools in the following way:
1. A single SVN repository
2. SQL Source Control for developers to check-in changes to this source tree.
3. Custom SQL Compare and SQL Data Compare scripts to deploy changes from the repository to our test, staging, production environmentsTesting we've done with the pre-release SQL Source Control have failed because it always tries to overwrite the data in the repository.
We won't be able to use the new release unless either we can completely disable data support in SQL Source Control, or the data support is enhanced to allow us to specify which columns to source-control. -
I do not want to source control certain columns in my reference tables (e.g., update date/times since these are different on each server and get set by a DEFAULT).