aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
authorbobufa <bobufa@users.noreply.github.com>2018-06-20 16:22:03 +0200
committerbobufa <bobufa@users.noreply.github.com>2018-08-13 21:55:48 +0200
commitab0bc7f04d156db9e398c3f8c4f8bdfc11dd7458 (patch)
tree1818eef1f7b459084531c5af02e5b06f119f5653 /libdino/src/service
parentc4928d46486c4117b1bf2738d114297a42cf1940 (diff)
downloaddino-ab0bc7f04d156db9e398c3f8c4f8bdfc11dd7458.tar.gz
dino-ab0bc7f04d156db9e398c3f8c4f8bdfc11dd7458.zip
enable fts for the body of messages
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/database.vala6
1 files changed, 5 insertions, 1 deletions
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<int> 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<Account> get_accounts() {