Skip to content

Commit 9536e60

Browse files
committed
Fix opening board migration of Shared Lists to Per-Swimlane lists to use ReactiveCache correctly without errors.
Thanks to xet7 ! Fixes #5960
1 parent 678ca97 commit 9536e60

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/migrations/fixMissingListsMigration.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import { Meteor } from 'meteor/meteor';
1919
import { check } from 'meteor/check';
2020
import { ReactiveCache } from '/imports/reactiveCache';
21+
import Boards from '/models/boards';
22+
import Lists from '/models/lists';
23+
import Cards from '/models/cards';
2124

2225
class FixMissingListsMigration {
2326
constructor() {
@@ -158,7 +161,7 @@ class FixMissingListsMigration {
158161
if (originalList.collapsed) newListData.collapsed = originalList.collapsed;
159162

160163
// Insert the new list
161-
const newListId = ReactiveCache.getCollection('lists').insert(newListData);
164+
const newListId = Lists.insert(newListData);
162165
targetList = { _id: newListId, ...newListData };
163166
createdLists++;
164167

@@ -167,7 +170,7 @@ class FixMissingListsMigration {
167170

168171
// Update all cards in this group to use the correct listId
169172
for (const card of cardsInList) {
170-
ReactiveCache.getCollection('cards').update(card._id, {
173+
Cards.update(card._id, {
171174
$set: {
172175
listId: targetList._id,
173176
modifiedAt: new Date()
@@ -179,7 +182,7 @@ class FixMissingListsMigration {
179182
}
180183

181184
// Mark board as processed
182-
ReactiveCache.getCollection('boards').update(boardId, {
185+
Boards.update(boardId, {
183186
$set: {
184187
fixMissingListsCompleted: true,
185188
fixMissingListsCompletedAt: new Date()

0 commit comments

Comments
 (0)