rename content db table -> content_item
This commit is contained in:
parent
1d9ce7f471
commit
f5547076d2
|
@ -43,7 +43,7 @@ public class Database : Qlite.Database {
|
|||
public Column<int> foreign_id = new Column.Integer("foreign_id") { not_null = true };
|
||||
|
||||
internal ContentTable(Database db) {
|
||||
base(db, "contentx");
|
||||
base(db, "content_item");
|
||||
init({id, conversation_id, time, local_time, content_type, foreign_id});
|
||||
unique({content_type, foreign_id}, "IGNORE");
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class Database : Qlite.Database {
|
|||
message.fts_rebuild();
|
||||
} else if (oldVersion < 8) {
|
||||
exec("""
|
||||
insert into contentx (conversation_id, time, local_time, content_type, foreign_id)
|
||||
insert into content_item (conversation_id, time, local_time, content_type, foreign_id)
|
||||
select conversation.id, message.time, message.local_time, 1, message.id
|
||||
from message join conversation on
|
||||
message.account_id=conversation.account_id and
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SearchProcessor : StreamInteractionModule, Object {
|
|||
.outer_join_with(db.real_jid, db.real_jid.message_id, db.message.id)
|
||||
.with(db.account.enabled, "=", true);
|
||||
if (join_content) {
|
||||
rows.join_on(db.content, "message.id=contentx.foreign_id AND contentx.content_type=1")
|
||||
rows.join_on(db.content, "message.id=content_item.foreign_id AND content_item.content_type=1")
|
||||
.with(db.content.content_type, "=", 1);
|
||||
}
|
||||
if (with != null) {
|
||||
|
@ -226,7 +226,7 @@ public class SearchProcessor : StreamInteractionModule, Object {
|
|||
|
||||
public Gee.List<MessageItem> match_messages(string query, int offset = -1) {
|
||||
Gee.List<MessageItem> ret = new ArrayList<MessageItem>();
|
||||
QueryBuilder rows = prepare_search(query, false).limit(10);
|
||||
QueryBuilder rows = prepare_search(query, true).limit(10);
|
||||
if (offset > 0) {
|
||||
rows.offset(offset);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue