fix indexes in table definitions