Use triggers to implement the referential integrity.