added indexes and constraints