Updating security rules with better notion of old foreign key constraints.