mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Handle Kryo version incompatibility
This commit is contained in:
parent
e42b884b13
commit
6829895995
@ -56,9 +56,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
|||||||
private static final int lokiV22 = 43;
|
private static final int lokiV22 = 43;
|
||||||
private static final int lokiV23 = 44;
|
private static final int lokiV23 = 44;
|
||||||
private static final int lokiV24 = 45;
|
private static final int lokiV24 = 45;
|
||||||
|
private static final int lokiV25 = 46;
|
||||||
|
|
||||||
// Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes
|
// Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes
|
||||||
private static final int DATABASE_VERSION = lokiV24;
|
private static final int DATABASE_VERSION = lokiV25;
|
||||||
private static final String DATABASE_NAME = "signal.db";
|
private static final String DATABASE_NAME = "signal.db";
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
@ -291,6 +292,12 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
|||||||
db.execSQL(LokiAPIDatabase.getCreateSwarmTableCommand());
|
db.execSQL(LokiAPIDatabase.getCreateSwarmTableCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldVersion < lokiV25) {
|
||||||
|
String jobTable = SessionJobDatabase.sessionJobTable;
|
||||||
|
db.execSQL("DROP TABLE " + jobTable);
|
||||||
|
db.execSQL(SessionJobDatabase.getCreateSessionJobTableCommand());
|
||||||
|
}
|
||||||
|
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
|
@ -14,7 +14,7 @@ import org.thoughtcrime.securesms.loki.utilities.*
|
|||||||
class SessionJobDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper) {
|
class SessionJobDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val sessionJobTable = "session_job_database"
|
const val sessionJobTable = "session_job_database"
|
||||||
const val jobID = "job_id"
|
const val jobID = "job_id"
|
||||||
const val jobType = "job_type"
|
const val jobType = "job_type"
|
||||||
const val failureCount = "failure_count"
|
const val failureCount = "failure_count"
|
||||||
|
Loading…
Reference in New Issue
Block a user