update db for foreign key indexing