Liam Dyer commited on
Commit
0f633f3
·
unverified ·
1 Parent(s): 853f8fc

Fix message update migration not applying (#1164)

Browse files

* fix: message update migration not applying

* feat: change message updates migration id to trigger re-run

src/lib/migrations/routines/04-update-message-updates.ts CHANGED
@@ -147,10 +147,10 @@ function convertMessageUpdate(message: Message, update: OldMessageUpdate): Messa
147
  }
148
 
149
  const updateMessageUpdates: Migration = {
150
- _id: new ObjectId("5f9f4f4f4f4f4f4f4f4f4f4f"),
151
  name: "Convert message updates to the new schema",
152
  up: async () => {
153
- const allConversations = collections.conversations.find({}, { projection: { messages: 1 } });
154
 
155
  let conversation: WithId<Pick<Conversation, "messages">> | null = null;
156
  while ((conversation = await allConversations.tryNext())) {
 
147
  }
148
 
149
  const updateMessageUpdates: Migration = {
150
+ _id: new ObjectId("5f9f7f7f7f7f7f7f7f7f7f7f"),
151
  name: "Convert message updates to the new schema",
152
  up: async () => {
153
+ const allConversations = collections.conversations.find({});
154
 
155
  let conversation: WithId<Pick<Conversation, "messages">> | null = null;
156
  while ((conversation = await allConversations.tryNext())) {