correctly returning IntegrityError on primary key violations