Added constraints to foreign keys