aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/database.vala
diff options
context:
space:
mode:
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);
+ }
}
}
}