BS-9747, update sql scripts to created named primary keys and add indexes for foreign keys