add indexes and give proper names to constraints