版本迁移室数据库。如何?

时间:2018-07-17 14:12:25

标签: android sqlite database-migration android-room

我遇到了一个问题,因此我不知道如何迁移数据库的以下更改:

@Insert(onConflict = OnConflictStrategy.REPLACE)   //onConflict was added
void insertContact(Contact contact);

@Entity(indices = {@Index(value = {"phonenumber"},
    unique = true)})                               // again Content in brackets was added

这就是我现在的全部:

static final Migration MIGRATION_2_3 = new Migration(2, 3) {
    @Override
    public void migrate(SupportSQLiteDatabase database) {
        // Migration
    }
};

0 个答案:

没有答案