aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/database.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/service/database.vala')
-rw-r--r--libdino/src/service/database.vala19
1 files changed, 17 insertions, 2 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala
index e47e24e9..58ff3b14 100644
--- a/libdino/src/service/database.vala
+++ b/libdino/src/service/database.vala
@@ -7,7 +7,7 @@ using Dino.Entities;
namespace Dino {
public class Database : Qlite.Database {
- private const int VERSION = 29;
+ private const int VERSION = 30;
public class AccountTable : Table {
public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
@@ -103,6 +103,19 @@ public class Database : Qlite.Database {
}
}
+ public class MessageOccupantId : Table {
+ public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
+ public Column<int> message_id = new Column.Integer("message_id") { not_null = true };
+ public Column<int> occupant_id = new Column.Integer("occupant_id") { not_null = true };
+
+ internal MessageOccupantId(Database db) {
+ base(db, "message_occupant_id");
+ init({id, message_id, occupant_id});
+
+ index("message_id_occupant_id", { message_id, occupant_id });
+ }
+ }
+
public class BodyMeta : Table {
public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
public Column<int> message_id = new Column.Integer("message_id");
@@ -440,6 +453,7 @@ public class Database : Qlite.Database {
public EntityTable entity { get; private set; }
public ContentItemTable content_item { get; private set; }
public MessageTable message { get; private set; }
+ public MessageOccupantId message_occupant_id { get; private set; }
public BodyMeta body_meta { get; private set; }
public ReplyTable reply { get; private set; }
public MessageCorrectionTable message_correction { get; private set; }
@@ -473,6 +487,7 @@ public class Database : Qlite.Database {
entity = new EntityTable(this);
content_item = new ContentItemTable(this);
message = new MessageTable(this);
+ message_occupant_id = new MessageOccupantId(this);
body_meta = new BodyMeta(this);
message_correction = new MessageCorrectionTable(this);
reply = new ReplyTable(this);
@@ -494,7 +509,7 @@ public class Database : Qlite.Database {
settings = new SettingsTable(this);
account_settings = new AccountSettingsTable(this);
conversation_settings = new ConversationSettingsTable(this);
- init({ account, jid, entity, content_item, message, body_meta, message_correction, reply, real_jid, occupantid, file_transfer, file_hashes, file_thumbnails, sfs_sources, call, call_counterpart, conversation, avatar, entity_identity, entity_feature, roster, mam_catchup, reaction, settings, account_settings, conversation_settings });
+ init({ account, jid, entity, content_item, message, message_occupant_id, body_meta, message_correction, reply, real_jid, occupantid, file_transfer, file_hashes, file_thumbnails, sfs_sources, call, call_counterpart, conversation, avatar, entity_identity, entity_feature, roster, mam_catchup, reaction, settings, account_settings, conversation_settings });
try {
exec("PRAGMA journal_mode = WAL");