aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/database.vala
diff options
context:
space:
mode:
authorSamuel Hand <samuel.hand@openmailbox.org>2018-08-14 02:00:39 +0100
committerSamuel Hand <samuel.hand@openmailbox.org>2018-08-14 02:00:39 +0100
commit65a12021bc7abbf5ddea068ffe9b4715cfc34f0b (patch)
treebbb241c28690713ebaa66c9fd0e74c62327b8ab2 /plugins/omemo/src/database.vala
parent3c819a19e194c0bbc06544813ff103ee0519f264 (diff)
downloaddino-65a12021bc7abbf5ddea068ffe9b4715cfc34f0b.tar.gz
dino-65a12021bc7abbf5ddea068ffe9b4715cfc34f0b.zip
Solve a few compiler warnings
Diffstat (limited to 'plugins/omemo/src/database.vala')
-rw-r--r--plugins/omemo/src/database.vala13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/omemo/src/database.vala b/plugins/omemo/src/database.vala
index 0b15d198..247c00f6 100644
--- a/plugins/omemo/src/database.vala
+++ b/plugins/omemo/src/database.vala
@@ -196,10 +196,15 @@ public class Database : Qlite.Database {
public override void migrate(long oldVersion) {
if(oldVersion == 1) {
- exec("DROP INDEX identity_meta_idx");
- exec("DROP INDEX identity_meta_list_idx");
- exec("CREATE UNIQUE INDEX identity_meta_idx ON identity_meta (identity_id, address_name, device_id)");
- exec("CREATE INDEX identity_meta_list_idx ON identity_meta (identity_id, address_name)");
+ try {
+ exec("DROP INDEX identity_meta_idx");
+ exec("DROP INDEX identity_meta_list_idx");
+ exec("CREATE UNIQUE INDEX identity_meta_idx ON identity_meta (identity_id, address_name, device_id)");
+ exec("CREATE INDEX identity_meta_list_idx ON identity_meta (identity_id, address_name)");
+ } catch (Error e) {
+ stderr.printf("Failed to migrate OMEMO database\n");
+ Process.exit(-1);
+ }
}
}
}