diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 15:35:51 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 15:35:51 +0100 |
commit | 196c8e593fa8f98027048d9e097507c108f1410e (patch) | |
tree | 76b76a9025eb4747f0711a17945b285fafe2efb8 /src/main/java/eu/siacs/conversations/persistance | |
parent | 0664d6ac7b8d0cefac8fa92df625fe653d606b1a (diff) | |
parent | e5f154316cbfa1d701947fae8bc31239df37531a (diff) |
Merge pull request #1595 from fiaxh/pgp_database_signature
Regenerate PGP signatures once
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 8b74581cc..2347c3188 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -43,7 +43,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { private static DatabaseBackend instance = null; private static final String DATABASE_NAME = "history"; - private static final int DATABASE_VERSION = 20; + private static final int DATABASE_VERSION = 21; private static String CREATE_CONTATCS_STATEMENT = "create table " + Contact.TABLENAME + "(" + Contact.ACCOUNT + " TEXT, " @@ -335,6 +335,15 @@ public class DatabaseBackend extends SQLiteOpenHelper { if (oldVersion < 18 && newVersion >= 18) { db.execSQL("ALTER TABLE " + Message.TABLENAME + " ADD COLUMN " + Message.READ + " NUMBER DEFAULT 1"); } + + if (oldVersion < 21 && newVersion >= 21) { + List<Account> accounts = getAccounts(db); + for (Account account : accounts) { + account.unsetPgpSignature(); + db.update(Account.TABLENAME, account.getContentValues(), Account.UUID + + "=?", new String[]{account.getUuid()}); + } + } } public static synchronized DatabaseBackend getInstance(Context context) { |