From c454bd904d1b9641ed333b71e206bd253fb9e9df Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 27 Dec 2020 17:24:48 +0100 Subject: [PATCH] Make db version 18 downgradable fixes #970 --- libdino/src/service/database.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 8b3e101d..652971a0 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -400,10 +400,10 @@ public class Database : Qlite.Database { if (oldVersion < 18) { try { exec("DROP INDEX contentitem_conversation_hide_localtime_time_idx"); - exec("CREATE INDEX contentitem_conversation_hide_time_idx ON content_item (conversation_id, hide, time)"); + exec("CREATE INDEX IF NOT EXISTS contentitem_conversation_hide_time_idx ON content_item (conversation_id, hide, time)"); exec("DROP INDEX message_account_counterpart_localtime_idx"); - exec("CREATE INDEX message_account_counterpart_time_idx ON message (account_id, counterpart_id, time)"); + exec("CREATE INDEX IF NOT EXISTS message_account_counterpart_time_idx ON message (account_id, counterpart_id, time)"); exec("DROP INDEX filetransfer_localtime_counterpart_idx"); } catch (Error e) {