我为我的 SQLite Db 进行了 DbFlow 迁移。我添加了两列并且构建成功问题是我在用户表中的任何地方都看不到这些列,我无法从它们插入或读取数据。可能是什么问题呢 ?
我的迁移代码。
package com.omnitech.elunda.mobile.database;
import com.raizlabs.android.dbflow.annotation.Database;
import com.raizlabs.android.dbflow.annotation.Migration;
import com.raizlabs.android.dbflow.sql.SQLiteType;
import com.raizlabs.android.dbflow.sql.migration.AlterTableMigration;
/**
* Created by magicwand on 9/28/2017.
* Database class to manage datastore
*/
@Database(name=ELundaDatabase.name , version=ELundaDatabase.VERSION)
public class ELundaDatabase {
public static final String name ="ElundaDatabase";
public static final int VERSION =1;
@Migration(version = ELundaDatabase.VERSION +1, database=ELundaDatabase.class)
public static class Migration1 extends AlterTableMigration<User> {
public Migration1(Class<User> table) {
super(table);
}
@Override
public void onPreMigrate() {
super.onPreMigrate();
addColumn(SQLiteType.TEXT, "phoneNumber");
addColumn(SQLiteType.TEXT, "password");
}
}
}