aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-07-10 02:24:33 +0200
committerAndreas Straub <andy@strb.org>2015-07-19 22:23:27 +0200
commit160e4017dfbd458325b8b63cf527f190b3f5bc2d (patch)
tree45c9266f9a82b2e70c6775eaeee67efcae52e9e5
parent461d0446f747edae3f7b8227e23577ab15cf1f9f (diff)
Fix IdentityKey storage model
Added proper UNIQUE statement
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
index 0da52010..0ba2876a 100644
--- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -96,11 +96,15 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ AxolotlService.SQLiteAxolotlStore.ACCOUNT + " TEXT, "
+ AxolotlService.SQLiteAxolotlStore.NAME + " TEXT, "
+ AxolotlService.SQLiteAxolotlStore.OWN + " INTEGER, "
- + AxolotlService.SQLiteAxolotlStore.FINGERPRINT + " TEXT PRIMARY KEY ON CONFLICT IGNORE, "
+ + AxolotlService.SQLiteAxolotlStore.FINGERPRINT + " TEXT, "
+ AxolotlService.SQLiteAxolotlStore.TRUSTED + " INTEGER, "
+ AxolotlService.SQLiteAxolotlStore.KEY + " TEXT, FOREIGN KEY("
+ AxolotlService.SQLiteAxolotlStore.ACCOUNT
- + ") REFERENCES " + Account.TABLENAME + "(" + Account.UUID + ") ON DELETE CASCADE "
+ + ") REFERENCES " + Account.TABLENAME + "(" + Account.UUID + ") ON DELETE CASCADE, "
+ + "UNIQUE( " + AxolotlService.SQLiteAxolotlStore.ACCOUNT + ", "
+ + AxolotlService.SQLiteAxolotlStore.NAME + ", "
+ + AxolotlService.SQLiteAxolotlStore.FINGERPRINT
+ + ") ON CONFLICT IGNORE"
+");";
private DatabaseBackend(Context context) {