mirror of
https://github.com/moparisthebest/Conversations
synced 2024-12-01 05:02:21 -05:00
Fix axolotl database migration
Can't call getWritableDatabase in recreateAxolotlDb()
This commit is contained in:
parent
2240066bbe
commit
dd964077b9
@ -289,7 +289,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
if (oldVersion < 15 && newVersion >= 15) {
|
if (oldVersion < 15 && newVersion >= 15) {
|
||||||
recreateAxolotlDb();
|
recreateAxolotlDb(db);
|
||||||
db.execSQL("ALTER TABLE " + Message.TABLENAME + " ADD COLUMN "
|
db.execSQL("ALTER TABLE " + Message.TABLENAME + " ADD COLUMN "
|
||||||
+ Message.FINGERPRINT + " TEXT");
|
+ Message.FINGERPRINT + " TEXT");
|
||||||
}
|
}
|
||||||
@ -910,8 +910,11 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void recreateAxolotlDb() {
|
public void recreateAxolotlDb() {
|
||||||
|
recreateAxolotlDb(getWritableDatabase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void recreateAxolotlDb(SQLiteDatabase db) {
|
||||||
Log.d(Config.LOGTAG, AxolotlService.LOGPREFIX+" : "+">>> (RE)CREATING AXOLOTL DATABASE <<<");
|
Log.d(Config.LOGTAG, AxolotlService.LOGPREFIX+" : "+">>> (RE)CREATING AXOLOTL DATABASE <<<");
|
||||||
SQLiteDatabase db = this.getWritableDatabase();
|
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + AxolotlService.SQLiteAxolotlStore.SESSION_TABLENAME);
|
db.execSQL("DROP TABLE IF EXISTS " + AxolotlService.SQLiteAxolotlStore.SESSION_TABLENAME);
|
||||||
db.execSQL(CREATE_SESSIONS_STATEMENT);
|
db.execSQL(CREATE_SESSIONS_STATEMENT);
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + AxolotlService.SQLiteAxolotlStore.PREKEY_TABLENAME);
|
db.execSQL("DROP TABLE IF EXISTS " + AxolotlService.SQLiteAxolotlStore.PREKEY_TABLENAME);
|
||||||
|
Loading…
Reference in New Issue
Block a user