Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32204543
D14845.1765115983.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14845.1765115983.diff
View Options
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -399,11 +399,14 @@
}
void SQLiteQueryExecutor::rekeyMessage(std::string from, std::string to) const {
- static std::string rekeyMessageSQL =
- "UPDATE OR REPLACE messages "
- "SET id = ? "
- "WHERE id = ?";
- rekeyAllEntities(this->getConnection(), rekeyMessageSQL, from, to);
+ constexpr std::string_view tables[] = {"messages", "backup_messages"};
+ for (const auto &table : tables) {
+ std::string rekeyMessageSQL = "UPDATE OR REPLACE " + std::string(table) +
+ " "
+ "SET id = ? "
+ "WHERE id = ?";
+ rekeyAllEntities(this->getConnection(), rekeyMessageSQL, from, to);
+ }
}
void SQLiteQueryExecutor::removeAllMedia() const {
@@ -470,9 +473,12 @@
void SQLiteQueryExecutor::rekeyMediaContainers(std::string from, std::string to)
const {
- static std::string rekeyMediaContainersSQL =
- "UPDATE media SET container = ? WHERE container = ?;";
- rekeyAllEntities(this->getConnection(), rekeyMediaContainersSQL, from, to);
+ constexpr std::string_view tables[] = {"media", "backup_media"};
+ for (const auto &table : tables) {
+ std::string rekeyMediaContainersSQL = "UPDATE " + std::string(table) +
+ " SET container = ? WHERE container = ?;";
+ rekeyAllEntities(this->getConnection(), rekeyMediaContainersSQL, from, to);
+ }
}
void SQLiteQueryExecutor::replaceMessageStoreThreads(
diff --git a/web/shared-worker/_generated/comm_query_executor.wasm b/web/shared-worker/_generated/comm_query_executor.wasm
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
literal 0
Hc$@<O00001
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 1:59 PM (14 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5844431
Default Alt Text
D14845.1765115983.diff (1 KB)
Attached To
Mode
D14845: [SQLite] update rekeying queries to support backup tables
Attached
Detach File
Event Timeline
Log In to Comment