possible fix for database migration crash

This commit is contained in:
dkanada 2021-05-16 12:04:22 +09:00
commit aa49d726f3
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ public class Cache {
public String id; public String id;
@ColumnInfo(defaultValue = "1") @ColumnInfo(defaultValue = "1")
public Boolean cache; public boolean cache;
public Cache() { public Cache() {
this.id = UUID.randomUUID().toString(); this.id = UUID.randomUUID().toString();

View file

@ -59,7 +59,7 @@ public abstract class JellyDatabase extends RoomDatabase {
@Override @Override
public void migrate(@NonNull SupportSQLiteDatabase database) { public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE cache (id TEXT NOT NULL PRIMARY KEY," database.execSQL("CREATE TABLE cache (id TEXT NOT NULL PRIMARY KEY,"
+ "cache INTEGER NOT NULL)"); + "cache INTEGER NOT NULL DEFAULT '1')");
} }
}; };
} }