Replaced foreign key with constraint