Force social graph to pull down updates after beta.11 install

This commit is contained in:
Scott Nonnenberg 2020-07-24 16:32:08 -07:00
parent d07b8e82b2
commit bab59ba2a1
13 changed files with 90 additions and 28 deletions

View file

@ -104,6 +104,7 @@ const dataInterface: ServerInterface = {
updateConversation,
updateConversations,
removeConversation,
eraseStorageIdFromConversations,
getAllConversations,
getAllConversationIds,
getAllPrivateConversations,
@ -2240,6 +2241,16 @@ async function getConversationById(id: string) {
return jsonToObject(row.json);
}
async function eraseStorageIdFromConversations() {
const db = getInstance();
await db.run(
`UPDATE conversations SET
json = json_remove(json, '$.storageID');
`
);
}
async function getAllConversations() {
const db = getInstance();
const rows = await db.all('SELECT json FROM conversations ORDER BY id ASC;');