created new function for adding materialized view primary key