How should Reference Data be implemented in State Based Continuous Database Deployment solutions?
The typical State Based solution I have come across is to use a series of post deploy SQL scripts that truncate reference data Tables and then proceed to INSERT
reference data one line at a time.
The issue with this typical solution is that environments can sometimes be changed by people outside of development and these changes need to be persisted. As a result a lot of manual comparisons are required to identify these changes during deploy cycles and less and less trust is put into automated deployments.
Are there any alternative solutions to this typical implementation that cater to situations where environments may have important changes that are not in source control?
-- Example of typical solution
-- drop existing data
TRUNCATE myReferenceData
-- insert all data to produce specific state
INSERT INTO myReferenceData (Col1, Col2) Values ("one", 1)
INSERT INTO myReferenceData (Col1, Col2) Values ("two", 2)
-- etc