From ab0bc7f04d156db9e398c3f8c4f8bdfc11dd7458 Mon Sep 17 00:00:00 2001 From: bobufa Date: Wed, 20 Jun 2018 16:22:03 +0200 Subject: [PATCH] enable fts for the body of messages --- libdino/src/service/database.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 25db82f8..2dca686f 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -6,7 +6,7 @@ using Dino.Entities; namespace Dino { public class Database : Qlite.Database { - private const int VERSION = 6; + private const int VERSION = 7; public class AccountTable : Table { public Column id = new Column.Integer("id") { primary_key = true, auto_increment = true }; @@ -54,6 +54,7 @@ public class Database : Qlite.Database { init({id, stanza_id, account_id, counterpart_id, our_resource, counterpart_resource, direction, type_, time, local_time, body, encryption, marked}); index("message_localtime_counterpart_idx", {local_time, counterpart_id}); + fts({body}); } } @@ -206,6 +207,9 @@ public class Database : Qlite.Database { public override void migrate(long oldVersion) { // new table columns are added, outdated columns are still present + if (oldVersion < 7) { + message.fts_rebuild(); + } } public ArrayList get_accounts() {