Set expiry to NULL where it was 0L, hopefully fixing migration issues
This commit is contained in:
parent
df204daece
commit
c8f730ced8
|
@ -51,7 +51,7 @@ import timber.log.Timber;
|
||||||
*/
|
*/
|
||||||
public class KeychainDatabase {
|
public class KeychainDatabase {
|
||||||
private static final String DATABASE_NAME = "openkeychain.db";
|
private static final String DATABASE_NAME = "openkeychain.db";
|
||||||
private static final int DATABASE_VERSION = 30;
|
private static final int DATABASE_VERSION = 31;
|
||||||
private final SupportSQLiteOpenHelper supportSQLiteOpenHelper;
|
private final SupportSQLiteOpenHelper supportSQLiteOpenHelper;
|
||||||
|
|
||||||
private static KeychainDatabase sInstance;
|
private static KeychainDatabase sInstance;
|
||||||
|
@ -363,9 +363,16 @@ public class KeychainDatabase {
|
||||||
|
|
||||||
case 29:
|
case 29:
|
||||||
recreateUnifiedKeyView(db);
|
recreateUnifiedKeyView(db);
|
||||||
|
|
||||||
|
case 30:
|
||||||
|
fixKeyExpiries(db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fixKeyExpiries(SupportSQLiteDatabase db) {
|
||||||
|
db.execSQL("UPDATE keys SET expiry = NULL WHERE expiry = 0;");
|
||||||
|
}
|
||||||
|
|
||||||
private void recreateUnifiedKeyView(SupportSQLiteDatabase db) {
|
private void recreateUnifiedKeyView(SupportSQLiteDatabase db) {
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
|
|
Loading…
Reference in a new issue