diff options
Diffstat (limited to 'libdino/src/service/database.vala')
-rw-r--r-- | libdino/src/service/database.vala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 01cc2f52..bea07dda 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -43,8 +43,9 @@ public class Database : Qlite.Database { public Column<int> foreign_id = new Column.Integer("foreign_id") { not_null = true }; internal ContentTable(Database db) { - base(db, "content"); + base(db, "contentx"); init({id, conversation_id, time, local_time, content_type, foreign_id}); + unique({content_type, foreign_id}, "IGNORE"); } } @@ -227,7 +228,7 @@ public class Database : Qlite.Database { message.fts_rebuild(); } else if (oldVersion < 8) { exec(""" - insert into content (conversation_id, time, local_time, content_type, foreign_id) + insert into contentx (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 |