title: how to deal with indices info during ROOM migration
body: <p>CODE:</p>
  
  <pre><code>@Entity(tableName = "UserRepo", indices = @Index(value = "id", unique = true))
  public class GitHubRepo {
  @PrimaryKey(autoGenerate = true)
  public int _id;
  public int id;
  public String name;
  public String description;
  @Embedded
  public RepoOwner owner;
  
  public GitHubRepo(int id, String name, String description, RepoOwner owner) {
      this.id = id;
      this.name = name;
      this.description = description;
      this.owner = owner;
  }
  
  public class RepoOwner {
  @ColumnInfo(name = "user_id")
  public int id;
  public String login;
  
  public RepoOwner(int id, String login) {
      this.id = id;
      this.login = login;
  }
  </code></pre>
  
  <p>Explain:
      I hava a ROOM database which contains a simple table <code>UserRepo</code>, this table contains three columns <code>_id, id, name</code> and use the "id" as the index in order to have a faster query.  For now, I want to use the <code>@Embedded annotation</code> to add the owner info in this table. The Migration code is follow:</p>
  
  <pre><code>public static final Migration MIGRATION_1_2 = new Migration(1, 2) {
      @Override
      public void migrate(@NonNull SupportSQLiteDatabase database) {
          database.execSQL("ALTER TABLE UserRepo ADD COLUMN user_id INTEGER");
          database.execSQL("ALTER TABLE UserRepo ADD COLUMN login TEXT");
      }
  };
  </code></pre>
  
  <p>During the migration, I got an error of:</p>
  
  <blockquote>
    <p><strong>Expected:</strong>
                                                                                         TableInfo</p>
  </blockquote>
  
  <pre><code>{name='UserRepo', columns={name=Column{name='name', type='TEXT', notNull=false, primaryKeyPosition=0}, description=Column{name='description', type='TEXT', notNull=false, primaryKeyPosition=0}, _id=Column{name='_id', type='INTEGER', notNull=true, primaryKeyPosition=1}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=0}, login=Column{name='login', type='TEXT', notNull=false, primaryKeyPosition=0}, user_id=Column{name='user_id', type='INTEGER', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], **indices=[Index{name='index_UserRepo_id', unique=true, columns=[id]}]**}
  </code></pre>
  
  <blockquote>
    <p><strong>Found:</strong> TableInfo</p>
  </blockquote>
  
  <pre><code>{name='UserRepo', columns={name=Column{name='name', type='TEXT', notNull=false, primaryKeyPosition=0}, description=Column{name='description', type='TEXT', notNull=false, primaryKeyPosition=0}, _id=Column{name='_id', type='INTEGER', notNull=true, primaryKeyPosition=1}, id=Column{name='id', type='INTEGER', notNull=true, primaryKeyPosition=0}, login=Column{name='login', type='TEXT', notNull=false, primaryKeyPosition=0}, user_id=Column{name='user_id', type='INTEGER', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], **indices=[]**}
  </code></pre>
  
  <p>Seems I lost the indices info in my Migration implement, How can I fix this? </p>
  
  <p><strong>ANOTHER INFO</strong> I can fix this issue by remove the indices info from the GitHubRepo entity, But I don't want to do this, as I don't want to lose the advantage of indices.</p>