1013837 - add missing associations

and add tests to ensure that all associations are there and configured
properly to avoid FK issues