Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(history): create file_transfers table in upgrade
Browse files Browse the repository at this point in the history
* bug introduced in refactor 3291723
  • Loading branch information
anthonybilinski committed May 9, 2019
1 parent e9f8795 commit c12605d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/persistence/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;"));
}
Expand Down

0 comments on commit c12605d

Please sign in to comment.