0
アンドロイドDBFLOW移行した後の列を参照してください。私は2つの列を追加し、ビルドは成功しました 問題は、私はどこでもUserテーブル内のそれらの列を参照することができないと、私は挿入またはそれらからデータを読み込むことができません。何が問題なの?カントは、私は私の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");
}
}
}