diff options
author | Rene Treffer <treffer@measite.de> | 2014-04-03 22:28:37 +0200 |
---|---|---|
committer | Rene Treffer <treffer@measite.de> | 2014-04-03 22:28:37 +0200 |
commit | a0fc1c6c77aea1d99078706cf2bee1c5efd246a4 (patch) | |
tree | a1646c57d5094a85d6a32614269b107a582c6f96 /src | |
parent | 4ea11c15e3670f7fe26dfa90b8493a01cfda9b10 (diff) |
Migrate all accounts to use compression
Diffstat (limited to 'src')
-rw-r--r-- | src/eu/siacs/conversations/persistance/DatabaseBackend.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java index 434d6779..4c0d6216 100644 --- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -23,7 +23,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { private static DatabaseBackend instance = null; 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) { super(context, DATABASE_NAME, null, DATABASE_VERSION); @@ -66,9 +66,12 @@ public class DatabaseBackend extends SQLiteOpenHelper { } @Override - public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) { - // TODO Auto-generated method stub - + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + 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) { |