'How to add index to many-to-many relationship in TypeORM

When I add a many-to-many relationship in typeORM entities, how can I add index to the relation columns?

@Entity()
export class Tag {
  @Column()
  id: number

  //@Index() does not work here...
  @ManyToMany(() => Todo, (todo) => todo.tags)
  todos: Todo[];

......


Solution 1:[1]

Turns out the indices are add automatically. Then I have to ask how can I tell typeORM not to add the index since it may not be needed.....enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Peter_101