// move stuck 0-length action messages to the existing "broken_messages" table. Not a real schema upgrade.
constautoschema3=schema2;
// create index in history table on chat_id to improve query speed. Not a real schema upgrade.
constQMap<QString,QString>schema4{
{"aliases","CREATE TABLE aliases (id INTEGER PRIMARY KEY, owner INTEGER, display_name BLOB NOT NULL, UNIQUE(owner, display_name))"},
{"faux_offline_pending","CREATE TABLE faux_offline_pending (id INTEGER PRIMARY KEY)"},
{"file_transfers","CREATE TABLE file_transfers (id INTEGER PRIMARY KEY, chat_id INTEGER NOT NULL, file_restart_id BLOB NOT NULL, file_name BLOB NOT NULL, file_path BLOB NOT NULL, file_hash BLOB NOT NULL, file_size INTEGER NOT NULL, direction INTEGER NOT NULL, file_state INTEGER NOT NULL)"},
{"history","CREATE TABLE history (id INTEGER PRIMARY KEY, timestamp INTEGER NOT NULL, chat_id INTEGER NOT NULL, sender_alias INTEGER NOT NULL, message BLOB NOT NULL, file_id INTEGER)"},
{"peers","CREATE TABLE peers (id INTEGER PRIMARY KEY, public_key TEXT NOT NULL UNIQUE)"},
{"broken_messages","CREATE TABLE broken_messages (id INTEGER PRIMARY KEY)"},
{"chat_id_idx","CREATE INDEX chat_id_idx on history (chat_id)"}