Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3342288
D5290.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5290.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
@@ -84,7 +84,7 @@
bool create_persist_account_table(sqlite3 *db) {
std::string query =
- "CREATE TABLE olm_persist_account("
+ "CREATE TABLE IF NOT EXISTS olm_persist_account("
"id INTEGER UNIQUE PRIMARY KEY NOT NULL, "
"account_data TEXT NOT NULL);";
return create_table(db, query, "olm_persist_account");
@@ -92,7 +92,7 @@
bool create_persist_sessions_table(sqlite3 *db) {
std::string query =
- "CREATE TABLE olm_persist_sessions("
+ "CREATE TABLE IF NOT EXISTS olm_persist_sessions("
"target_user_id TEXT UNIQUE PRIMARY KEY NOT NULL, "
"session_data TEXT NOT NULL);";
return create_table(db, query, "olm_persist_sessions");
@@ -132,7 +132,7 @@
char *error;
sqlite3_exec(
db,
- "CREATE INDEX messages_idx_thread_time "
+ "CREATE INDEX IF NOT EXISTS messages_idx_thread_time "
"ON messages (thread, time);",
nullptr,
nullptr,
@@ -167,7 +167,7 @@
char *error;
sqlite3_exec(
db,
- "CREATE INDEX media_idx_container "
+ "CREATE INDEX IF NOT EXISTS media_idx_container "
"ON media (container);",
nullptr,
nullptr,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 1:07 AM (18 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566967
Default Alt Text
D5290.diff (1 KB)
Attached To
Mode
D5290: [native/sqlite] add `IF NOT EXISTS` constraint to migrations
Attached
Detach File
Event Timeline
Log In to Comment