Add primary and foreign keys to db tables