summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-06-26 02:11:37 +0300
committerLauri Ojansivu <x@xet7.org>2018-06-26 02:11:37 +0300
commit97922c90cb42be6c6615639bb164173748982f56 (patch)
treeb24f2ecaf1009527d6a469d59072365e26d3d113
parentc372ea02f7b3667b8fe45fbd761ac23d3a1bbcc4 (diff)
downloadwekan-97922c90cb42be6c6615639bb164173748982f56.tar.gz
wekan-97922c90cb42be6c6615639bb164173748982f56.tar.bz2
wekan-97922c90cb42be6c6615639bb164173748982f56.zip
- Fix "Error: title is required" by removing find() from all of migrations.
Thanks to xet7 ! Closes #1576
-rw-r--r--server/migrations.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/migrations.js b/server/migrations.js
index a1a5c65a..976e478c 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -55,7 +55,7 @@ Migrations.add('lowercase-board-permission', () => {
// Security migration: see https://github.com/wekan/wekan/issues/99
Migrations.add('change-attachments-type-for-non-images', () => {
const newTypeForNonImage = 'application/octet-stream';
- Attachments.find().forEach((file) => {
+ Attachments.forEach((file) => {
if (!file.isImage()) {
Attachments.update(file._id, {
$set: {
@@ -68,7 +68,7 @@ Migrations.add('change-attachments-type-for-non-images', () => {
});
Migrations.add('card-covers', () => {
- Cards.find().forEach((card) => {
+ Cards.forEach((card) => {
const cover = Attachments.findOne({ cardId: card._id, cover: true });
if (cover) {
Cards.update(card._id, {$set: {coverId: cover._id}}, noValidate);
@@ -86,7 +86,7 @@ Migrations.add('use-css-class-for-boards-colors', () => {
'#2C3E50': 'midnight',
'#E67E22': 'pumpkin',
};
- Boards.find().forEach((board) => {
+ Boards.forEach((board) => {
const oldBoardColor = board.background.color;
const newBoardColor = associationTable[oldBoardColor];
Boards.update(board._id, {
@@ -97,7 +97,7 @@ Migrations.add('use-css-class-for-boards-colors', () => {
});
Migrations.add('denormalize-star-number-per-board', () => {
- Boards.find().forEach((board) => {
+ Boards.forEach((board) => {
const nStars = Users.find({'profile.starredBoards': board._id}).count();
Boards.update(board._id, {$set: {stars: nStars}}, noValidate);
});
@@ -132,7 +132,7 @@ Migrations.add('add-member-isactive-field', () => {
});
Migrations.add('add-sort-checklists', () => {
- Checklists.find().forEach((checklist, index) => {
+ Checklists.forEach((checklist, index) => {
if (!checklist.hasOwnProperty('sort')) {
Checklists.direct.update(
checklist._id,
@@ -153,7 +153,7 @@ Migrations.add('add-sort-checklists', () => {
});
Migrations.add('add-swimlanes', () => {
- Boards.find().forEach((board) => {
+ Boards.forEach((board) => {
const swimlane = Swimlanes.findOne({ boardId: board._id });
let swimlaneId = '';
if (swimlane)
@@ -177,7 +177,7 @@ Migrations.add('add-swimlanes', () => {
});
Migrations.add('add-views', () => {
- Boards.find().forEach((board) => {
+ Boards.forEach((board) => {
if (!board.hasOwnProperty('view')) {
Boards.direct.update(
{ _id: board._id },
@@ -189,7 +189,7 @@ Migrations.add('add-views', () => {
});
Migrations.add('add-checklist-items', () => {
- Checklists.find().forEach((checklist) => {
+ Checklists.forEach((checklist) => {
// Create new items
_.sortBy(checklist.items, 'sort').forEach((item, index) => {
ChecklistItems.direct.insert({
@@ -210,7 +210,7 @@ Migrations.add('add-checklist-items', () => {
});
Migrations.add('add-profile-view', () => {
- Users.find().forEach((user) => {
+ Users.forEach((user) => {
if (!user.hasOwnProperty('profile.boardView')) {
// Set default view
Users.direct.update(