RichardBrett
6 years agoQrew Trainee
Enforce single use of a record in a relationship
I am having a bad brain lapse.
The basic use case is, I have Sample Data that we combine with 4 other pieces of Sample Data to produce a Unique outcome. Each piece of Sample Data can only be used Once.
In case it is confusing the best way to look at it is each sample is a limited resource with only enough of that resource to be used in one test combination.
I am running myself in circles on how to set up the structure to enforce each Sample can only be used once.
I was looking at doing 3 tables, SampleData, UsedSamples & CombinationResults.
With UsedSamples being the join table between SampleData and CombinationResults.
Was looking at Key field in SampleData is an 8 digit unique text field and a unique 8 digit Text field as the Key in the CombinationResults Field.
Any simple or brilliant ways for me to enforce the single use of each SampleData?
The basic use case is, I have Sample Data that we combine with 4 other pieces of Sample Data to produce a Unique outcome. Each piece of Sample Data can only be used Once.
In case it is confusing the best way to look at it is each sample is a limited resource with only enough of that resource to be used in one test combination.
I am running myself in circles on how to set up the structure to enforce each Sample can only be used once.
I was looking at doing 3 tables, SampleData, UsedSamples & CombinationResults.
With UsedSamples being the join table between SampleData and CombinationResults.
Was looking at Key field in SampleData is an 8 digit unique text field and a unique 8 digit Text field as the Key in the CombinationResults Field.
Any simple or brilliant ways for me to enforce the single use of each SampleData?