mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
Migrate all accounts to use compression
This commit is contained in:
parent
4ea11c15e3
commit
a0fc1c6c77
@ -23,7 +23,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||||||
private static DatabaseBackend instance = null;
|
private static DatabaseBackend instance = null;
|
||||||
|
|
||||||
private static final String DATABASE_NAME = "history";
|
private static final String DATABASE_NAME = "history";
|
||||||
private static final int DATABASE_VERSION = 1;
|
private static final int DATABASE_VERSION = 2;
|
||||||
|
|
||||||
public DatabaseBackend(Context context) {
|
public DatabaseBackend(Context context) {
|
||||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||||
@ -66,9 +66,12 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
// TODO Auto-generated method stub
|
if (oldVersion < 2 && newVersion >= 2) {
|
||||||
|
// enable compression by default.
|
||||||
|
db.execSQL("update " + Account.TABLENAME
|
||||||
|
+ " set " + Account.OPTIONS + " = " + Account.OPTIONS + " | 8");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized DatabaseBackend getInstance(Context context) {
|
public static synchronized DatabaseBackend getInstance(Context context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user