Add tests for foreign keys update