I'm concerned that I have a data integrity issue involving the Versions
and VersionQuestions
tables. For example, if DefMasterID
is changed in the Versions
table, it will point to a different master definition, but the child records in Questions
will still be pointing at records in the MasterQuestionsPool
that belong to the original survey master. Ideally, the constraints would prevent this but I don't think they will.
Do I have integrity with this design? If not, what is the appropriate path to take to ensure integrity?
The above schema is based on these requirements:
There need to be multiple survey master definitions that represent significantly different surveys.
A master survey definition needs one or more versions, which represent small differences.
Each survey master has a pool of questions, which are shared between its versions. An individual version generally will not use all questions. This provides the ability to compare answers across all versions of a survey master.