We have a database where we store commands and properties for devices that may be controlled via a network.
For instance, "Concrete Device" is an instance of some
DeviceType, which in turn contains
We have the ability to get values of the properties of devices by analyzing responses on commands; therefore there is a relationship between commands and properties. A problem arises when we trying to link commands from one
DeviceType to properties from another
DeviceType - this kind of link is useless and confusing.
How can I prevent this 'circular reference' through integrity constraints?
Here is a SqlFiddle for my scenario.