|
@@ -18,6 +18,9 @@
|
|
import { Meteor } from 'meteor/meteor';
|
|
import { Meteor } from 'meteor/meteor';
|
|
import { check } from 'meteor/check';
|
|
import { check } from 'meteor/check';
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
|
|
+import Boards from '/models/boards';
|
|
|
|
+import Lists from '/models/lists';
|
|
|
|
+import Cards from '/models/cards';
|
|
|
|
|
|
class FixMissingListsMigration {
|
|
class FixMissingListsMigration {
|
|
constructor() {
|
|
constructor() {
|
|
@@ -158,7 +161,7 @@ class FixMissingListsMigration {
|
|
if (originalList.collapsed) newListData.collapsed = originalList.collapsed;
|
|
if (originalList.collapsed) newListData.collapsed = originalList.collapsed;
|
|
|
|
|
|
// Insert the new list
|
|
// Insert the new list
|
|
- const newListId = ReactiveCache.getCollection('lists').insert(newListData);
|
|
|
|
|
|
+ const newListId = Lists.insert(newListData);
|
|
targetList = { _id: newListId, ...newListData };
|
|
targetList = { _id: newListId, ...newListData };
|
|
createdLists++;
|
|
createdLists++;
|
|
|
|
|
|
@@ -167,7 +170,7 @@ class FixMissingListsMigration {
|
|
|
|
|
|
// Update all cards in this group to use the correct listId
|
|
// Update all cards in this group to use the correct listId
|
|
for (const card of cardsInList) {
|
|
for (const card of cardsInList) {
|
|
- ReactiveCache.getCollection('cards').update(card._id, {
|
|
|
|
|
|
+ Cards.update(card._id, {
|
|
$set: {
|
|
$set: {
|
|
listId: targetList._id,
|
|
listId: targetList._id,
|
|
modifiedAt: new Date()
|
|
modifiedAt: new Date()
|
|
@@ -179,7 +182,7 @@ class FixMissingListsMigration {
|
|
}
|
|
}
|
|
|
|
|
|
// Mark board as processed
|
|
// Mark board as processed
|
|
- ReactiveCache.getCollection('boards').update(boardId, {
|
|
|
|
|
|
+ Boards.update(boardId, {
|
|
$set: {
|
|
$set: {
|
|
fixMissingListsCompleted: true,
|
|
fixMissingListsCompleted: true,
|
|
fixMissingListsCompletedAt: new Date()
|
|
fixMissingListsCompletedAt: new Date()
|