added indices and primary keys