bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
790 stars 38 forks source link

SQL Lite errors with newer DB formats #98

Closed crimsoncor closed 1 year ago

crimsoncor commented 1 year ago

backup tools is working fine for me with db versions up to 157. Got some newer backups I'm trying to merge (db versions 171 and 179) and they do not appear to work with the tool. A basic --listthreads yields the following SQL error with 179

Reading backup file...
FRAME 4190 (100.0%)... Read entire backup file...

done!
Database version: 179
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT MIN(mindate) AS 'Min Date', MAX(maxdate) AS 'Max Date' FROM (SELECT MIN(sms.date) AS mindate, MAX(sms.date) AS maxdate FROM sms UNION ALL SELECT MIN(mms.date_received) AS mindate, MAX(mms.date_received) AS maxdate FROM mms)"
(no results)
Error : During sqlite3_prepare_v2(): no such column: thread.thread_recipient_id
  Query: "SELECT thread._id, COALESCE(recipient.phone, recipient.group_id) AS 'recipient_ids', thread.snippet, COALESCE(recipient.system_display_name, recipient.profile_joined_name, recipient.signal_profile_name, groups.title) AS 'Conversation partner' FROM thread LEFT JOIN recipient ON thread.thread_recipient_id = recipient._id LEFT JOIN groups ON recipient.group_id = groups.group_id ORDER BY thread._id ASC"

and with v171 a similar

FRAME 31289 (100.0%)... Read entire backup file...

done!
Database version: 171
Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "SELECT MIN(mindate) AS 'Min Date', MAX(maxdate) AS 'Max Date' FROM (SELECT MIN(sms.date) AS mindate, MAX(sms.date) AS maxdate FROM sms UNION ALL SELECT MIN(mms.date_received) AS mindate, MAX(mms.date_received) AS maxdate FROM mms)"
(no results)
Error : During sqlite3_prepare_v2(): no such column: thread.thread_recipient_id
  Query: "SELECT thread._id, COALESCE(recipient.phone, recipient.group_id) AS 'recipient_ids', thread.snippet, COALESCE(recipient.system_display_name, recipient.profile_joined_name, recipient.signal_profile_name, groups.title) AS 'Conversation partner' FROM thread LEFT JOIN recipient ON thread.thread_recipient_id = recipient._id LEFT JOIN groups ON recipient.group_id = groups.group_id ORDER BY thread._id ASC"

I fetched latest in the master branch and rebuilt (since I figured this was related to Signal recently removing support for sms and mms from the app) but that did not seem to make a difference.

Attempting to a date prune leads to way more angry errors as well

Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "DELETE FROM sms WHERE date NOT BETWEEN ? AND ?"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM mms WHERE date_received NOT BETWEEN ? AND ?"
cleanDatabaseByMessages
  Deleting attachment entries from 'part' not belonging to remaining mms entries
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM part WHERE mid NOT IN (SELECT DISTINCT _id FROM mms)"
  Deleting other threads from 'thread'...
Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "DELETE FROM thread WHERE _id NOT IN (SELECT DISTINCT thread_id FROM sms) AND _id NOT IN (SELECT DISTINCT thread_id FROM mms)"
updateThreadsEntries
  Dealing with thread id: 1Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 1) + (SELECT count(*) FROM mms WHERE thread_id = 1)) WHERE _id = 1"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 1 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 1 ORDER BY union_date DESC LIMIT 1"
, 2Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 2) + (SELECT count(*) FROM mms WHERE thread_id = 2)) WHERE _id = 2"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 2 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 2 ORDER BY union_date DESC LIMIT 1"
, 3Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 3) + (SELECT count(*) FROM mms WHERE thread_id = 3)) WHERE _id = 3"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 3 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 3 ORDER BY union_date DESC LIMIT 1"
, 4Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 4) + (SELECT count(*) FROM mms WHERE thread_id = 4)) WHERE _id = 4"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 4 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 4 ORDER BY union_date DESC LIMIT 1"
, 5Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 5) + (SELECT count(*) FROM mms WHERE thread_id = 5)) WHERE _id = 5"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 5 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 5 ORDER BY union_date DESC LIMIT 1"
, 6Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 6) + (SELECT count(*) FROM mms WHERE thread_id = 6)) WHERE _id = 6"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 6 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 6 ORDER BY union_date DESC LIMIT 1"
, 7Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 7) + (SELECT count(*) FROM mms WHERE thread_id = 7)) WHERE _id = 7"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 7 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 7 ORDER BY union_date DESC LIMIT 1"
, 8Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 8) + (SELECT count(*) FROM mms WHERE thread_id = 8)) WHERE _id = 8"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 8 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 8 ORDER BY union_date DESC LIMIT 1"
, 9Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 9) + (SELECT count(*) FROM mms WHERE thread_id = 9)) WHERE _id = 9"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 9 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 9 ORDER BY union_date DESC LIMIT 1"
, 10Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 10) + (SELECT count(*) FROM mms WHERE thread_id = 10)) WHERE _id = 10"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 10 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 10 ORDER BY union_date DESC LIMIT 1"
, 11Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 11) + (SELECT count(*) FROM mms WHERE thread_id = 11)) WHERE _id = 11"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 11 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 11 ORDER BY union_date DESC LIMIT 1"
, 12Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 12) + (SELECT count(*) FROM mms WHERE thread_id = 12)) WHERE _id = 12"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 12 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 12 ORDER BY union_date DESC LIMIT 1"
, 13Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 13) + (SELECT count(*) FROM mms WHERE thread_id = 13)) WHERE _id = 13"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 13 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 13 ORDER BY union_date DESC LIMIT 1"
, 14Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 14) + (SELECT count(*) FROM mms WHERE thread_id = 14)) WHERE _id = 14"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 14 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 14 ORDER BY union_date DESC LIMIT 1"
, 15Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 15) + (SELECT count(*) FROM mms WHERE thread_id = 15)) WHERE _id = 15"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 15 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 15 ORDER BY union_date DESC LIMIT 1"
, 16Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 16) + (SELECT count(*) FROM mms WHERE thread_id = 16)) WHERE _id = 16"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 16 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 16 ORDER BY union_date DESC LIMIT 1"
, 17Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 17) + (SELECT count(*) FROM mms WHERE thread_id = 17)) WHERE _id = 17"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 17 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 17 ORDER BY union_date DESC LIMIT 1"
, 18Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 18) + (SELECT count(*) FROM mms WHERE thread_id = 18)) WHERE _id = 18"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 18 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 18 ORDER BY union_date DESC LIMIT 1"
, 19Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 19) + (SELECT count(*) FROM mms WHERE thread_id = 19)) WHERE _id = 19"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 19 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 19 ORDER BY union_date DESC LIMIT 1"
, 20Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 20) + (SELECT count(*) FROM mms WHERE thread_id = 20)) WHERE _id = 20"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 20 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 20 ORDER BY union_date DESC LIMIT 1"
, 21Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 21) + (SELECT count(*) FROM mms WHERE thread_id = 21)) WHERE _id = 21"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 21 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 21 ORDER BY union_date DESC LIMIT 1"
, 22Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 22) + (SELECT count(*) FROM mms WHERE thread_id = 22)) WHERE _id = 22"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 22 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 22 ORDER BY union_date DESC LIMIT 1"
, 23Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 23) + (SELECT count(*) FROM mms WHERE thread_id = 23)) WHERE _id = 23"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 23 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 23 ORDER BY union_date DESC LIMIT 1"
, 24Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 24) + (SELECT count(*) FROM mms WHERE thread_id = 24)) WHERE _id = 24"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 24 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 24 ORDER BY union_date DESC LIMIT 1"
, 25Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 25) + (SELECT count(*) FROM mms WHERE thread_id = 25)) WHERE _id = 25"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 25 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 25 ORDER BY union_date DESC LIMIT 1"
, 26Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 26) + (SELECT count(*) FROM mms WHERE thread_id = 26)) WHERE _id = 26"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 26 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 26 ORDER BY union_date DESC LIMIT 1"
, 27Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "UPDATE thread SET message_count = (SELECT (SELECT count(*) FROM sms WHERE thread_id = 27) + (SELECT count(*) FROM mms WHERE thread_id = 27)) WHERE _id = 27"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT sms.date_sent AS union_date, sms.type AS union_type, sms.body AS union_body, sms._id AS [sms._id], '' AS [mms._id] FROM 'sms' WHERE sms.thread_id = 27 UNION SELECT mms.date AS union_display_date, mms.msg_box AS union_type, mms.body AS union_body, '' AS [sms._id], mms._id AS [mms._id] FROM mms WHERE mms.thread_id = 27 ORDER BY union_date DESC LIMIT 1"

  Deleting entries from 'mention' not belonging to remaining mms entries
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM mention WHERE message_id NOT IN (SELECT DISTINCT _id FROM mms) OR thread_id NOT IN (SELECT DISTINCT _id FROM thread)"
  Deleting removed groups...
Error : During sqlite3_prepare_v2(): no such column: thread_recipient_id
  Query: "DELETE FROM groups WHERE recipient_id NOT IN (SELECT DISTINCT thread_recipient_id FROM thread)"
  Deleting unneeded MessageSendLog entries...
Error : During sqlite3_prepare_v2(): no such column: is_mms
  Query: "DELETE FROM msl_message WHERE is_mms IS NOT 1 AND message_id NOT IN (SELECT _id FROM sms)"
Error : During sqlite3_prepare_v2(): no such column: is_mms
  Query: "DELETE FROM msl_message WHERE is_mms IS 1 AND message_id NOT IN (SELECT _id FROM mms)"
  Deleting reactions to non-existing messages
Error : During sqlite3_prepare_v2(): no such column: is_mms
  Query: "DELETE FROM reaction WHERE is_mms IS NOT 1 AND message_id NOT IN (SELECT _id FROM sms)"
Error : During sqlite3_prepare_v2(): no such column: is_mms
  Query: "DELETE FROM reaction WHERE is_mms IS 1 AND message_id NOT IN (SELECT _id FROM mms)"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM story_sends WHERE message_id NOT IN (SELECT _id FROM mms)"
  Deleting unreferenced recipient entries...
Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "SELECT body FROM sms WHERE type == ?"
Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "SELECT body FROM sms WHERE (type & ?) != 0 AND (type & ?) != 0"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "SELECT body FROM mms WHERE (msg_box & ?) != 0 AND (msg_box & ?) != 0"
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM recipient WHERE _id NOT IN (SELECT DISTINCT address FROM sms UNION SELECT DISTINCT address FROM mms UNION SELECT DISTINCT recipient_id FROM mention UNION SELECT DISTINCT author_id FROM reaction UNION SELECT DISTINCT recipient_id FROM story_sends UNION SELECT * FROM (VALUES(130)) UNION SELECT DISTINCT thread_recipient_id FROM thread) RETURNING _id,distribution_list_id"
  Deleting unneeded notification profiles entries...
  Deleting unused avatars...
  Deleting unused attachments...
  Delete others from 'identities'
  Deleting group_receipts entries from deleted messages...
Error : During sqlite3_prepare_v2(): no such table: mms
  Query: "DELETE FROM group_receipts WHERE mms_id NOT IN (SELECT DISTINCT _id FROM mms)"
  Deleting group_receipts from non-existing recipients
  Deleting drafts from deleted threads...
Error : During sqlite3_prepare_v2(): no such table: sms
  Query: "DELETE FROM drafts WHERE thread_id NOT IN (SELECT DISTINCT thread_id FROM sms) AND thread_id NOT IN (SELECT DISTINCT thread_id FROM mms)"
  Deleting remapped recipients for non existing recipients
  Vacuuming database
crimsoncor commented 1 year ago

image Diff of the table names changes across the different db versions. Looks like sms was consolidated into mms at some point before v171 and then renamed to message* in a later update

crimsoncor commented 1 year ago

Welp, apparently what I thought I had built, I did not build. Everything is fine in the latest build. sorry.