Now, for the second catastrophe of the day:
I have three tables that overlap.
The fields in the parent table Techs are:
SystemNum, and SupNum TechNum is the primary field.
The child table Systems is indexed by SystemNum
and the other child Supervisors is indexed by (you guessed it) SupNum
I am trying to set up the foreign field for Systems like this:
ALTER TABLE `CallsToDispatch`.`Systems`
ADD CONSTRAINT `sys` FOREIGN KEY (`SystemNum`)
REFERENCES `CallsToDispatch`.`Techs` (`SystemNum`)
ON UPDATE CASCADE ON DELETE NO ACTION;
When I try this, I get the very helpful "Cannot add foreign key constraint". The two fields are identical in both parent and child. How would I go about strangling a more descriptive error message, so I can see what I need to change?