Adding check to ensure that the primary key has a value