enable fts for the body of messages
This commit is contained in:
parent
c4928d4648
commit
ab0bc7f04d
|
@ -6,7 +6,7 @@ using Dino.Entities;
|
||||||
namespace Dino {
|
namespace Dino {
|
||||||
|
|
||||||
public class Database : Qlite.Database {
|
public class Database : Qlite.Database {
|
||||||
private const int VERSION = 6;
|
private const int VERSION = 7;
|
||||||
|
|
||||||
public class AccountTable : Table {
|
public class AccountTable : Table {
|
||||||
public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
|
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,
|
init({id, stanza_id, account_id, counterpart_id, our_resource, counterpart_resource, direction,
|
||||||
type_, time, local_time, body, encryption, marked});
|
type_, time, local_time, body, encryption, marked});
|
||||||
index("message_localtime_counterpart_idx", {local_time, counterpart_id});
|
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) {
|
public override void migrate(long oldVersion) {
|
||||||
// new table columns are added, outdated columns are still present
|
// new table columns are added, outdated columns are still present
|
||||||
|
if (oldVersion < 7) {
|
||||||
|
message.fts_rebuild();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Account> get_accounts() {
|
public ArrayList<Account> get_accounts() {
|
||||||
|
|
Loading…
Reference in a new issue