소스 검색

Merge branch 'rjevnikar-boardViewMigration' into devel

Fixes #1675
Lauri Ojansivu 7 년 전
부모
커밋
8471f389eb
2개의 변경된 파일16개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 0
      CHANGELOG.md
  2. 8 6
      server/migrations.js

+ 8 - 0
CHANGELOG.md

@@ -1,3 +1,11 @@
+# Upcoming Wekan release
+
+This release possibly fixes the following bugs, please test:
+
+* [Try to fix: Missing board-view-lists Field after DB updated to Wekan 1.02](https://github.com/wekan/wekan/issues/1675).
+
+Thanks to GitHub user rjevnikar for contributions.
+
 # v1.02 2018-05-26 Wekan release
 # v1.02 2018-05-26 Wekan release
 
 
 This release fixes the following bugs:
 This release fixes the following bugs:

+ 8 - 6
server/migrations.js

@@ -211,12 +211,14 @@ Migrations.add('add-checklist-items', () => {
 
 
 Migrations.add('add-profile-view', () => {
 Migrations.add('add-profile-view', () => {
   Users.find().forEach((user) => {
   Users.find().forEach((user) => {
-    // Set default view
-    Users.direct.update(
-      { _id: user._id },
-      { $set: { 'profile.boardView': 'board-view-lists' } },
-      noValidate
-    );
+    if (!user.hasOwnProperty('profile.boardView')) {
+      // Set default view
+      Users.direct.update(
+        { _id: user._id },
+        { $set: { 'profile.boardView': 'board-view-lists' } },
+        noValidate
+      );
+    }
   });
   });
 });
 });