小编Jun*_* Du的帖子

在ROOM迁移期间如何处理索引信息

码:

@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; …
Run Code Online (Sandbox Code Playgroud)

migration android

4
推荐指数
1
解决办法
1721
查看次数

标签 统计

android ×1

migration ×1