Updated database to the new schema and added indices