From c12605db6d645ca313997543c8057a3dfd87bb48 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Thu, 9 May 2019 00:19:46 -0700 Subject: [PATCH] fix(history): create file_transfers table in upgrade * bug introduced in refactor 329172321d3fd5fac3b0087d7d19863b084295ea --- src/persistence/history.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/persistence/history.cpp b/src/persistence/history.cpp index 801b5b845..14f8a3e4a 100644 --- a/src/persistence/history.cpp +++ b/src/persistence/history.cpp @@ -713,6 +713,18 @@ void History::dbSchemaUpgrade() break; // new db is the only case where we don't incrementally upgrade through each version } else { // it's a db that exists but at the first versioned schema, version 0. + queries += + RawDatabase::Query(QStringLiteral( + "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);")); queries += RawDatabase::Query(QStringLiteral("ALTER TABLE history ADD file_id INTEGER;")); }