Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3304905
D11904.id39962.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
D11904.id39962.diff
View Options
diff --git a/keyserver/src/creators/thread-creator.js b/keyserver/src/creators/thread-creator.js
--- a/keyserver/src/creators/thread-creator.js
+++ b/keyserver/src/creators/thread-creator.js
@@ -323,12 +323,26 @@
}
} else {
const query = SQL`
+ START TRANSACTION;
+
INSERT INTO threads(id, type, name, description, creator, creation_time,
color, parent_thread_id, containing_thread_id, community, depth,
source_message)
- VALUES ${[row]}
+ VALUES ${[row]};
`;
- await dbQuery(query);
+
+ if (threadTypeIsCommunityRoot(threadType)) {
+ query.append(SQL`
+ INSERT INTO communities (id)
+ VALUES (${id});
+ `);
+ }
+
+ query.append(SQL`
+ COMMIT;
+ `);
+
+ await dbQuery(query, { multipleStatements: true });
}
const initialMemberPromise: Promise<?MembershipChangeset> = initialMemberIDs
diff --git a/keyserver/src/deleters/thread-deleters.js b/keyserver/src/deleters/thread-deleters.js
--- a/keyserver/src/deleters/thread-deleters.js
+++ b/keyserver/src/deleters/thread-deleters.js
@@ -95,6 +95,7 @@
const deletionQuery = SQL`
START TRANSACTION;
DELETE FROM threads WHERE id IN (${threadIDs});
+ DELETE FROM communities WHERE id IN (${threadIDs});
DELETE FROM ids WHERE id IN (${threadIDs});
DELETE d, id, e, ie, r, ir
FROM days d
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 12:18 PM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2537725
Default Alt Text
D11904.id39962.diff (1 KB)
Attached To
Mode
D11904: [keyserver] modify thread creator + deleter endpoints to update communities table
Attached
Detach File
Event Timeline
Log In to Comment