2022-01-30 15:26:11 +03:00
|
|
|
|
import fs from 'fs';
|
|
|
|
|
import path from 'path';
|
2021-07-10 10:55:54 +02:00
|
|
|
|
import { TAPi18n } from '/imports/i18n';
|
2019-06-26 17:47:27 -05:00
|
|
|
|
import AccountSettings from '../models/accountSettings';
|
2021-08-27 16:25:44 +02:00
|
|
|
|
import TableVisibilityModeSettings from '../models/tableVisibilityModeSettings';
|
2019-06-26 17:47:27 -05:00
|
|
|
|
import Actions from '../models/actions';
|
|
|
|
|
import Activities from '../models/activities';
|
|
|
|
|
import Announcements from '../models/announcements';
|
2020-09-16 09:50:09 -05:00
|
|
|
|
import Attachments from '../models/attachments';
|
2020-10-20 12:55:28 -05:00
|
|
|
|
import AttachmentsOld from '../models/attachments_old';
|
|
|
|
|
import Avatars from '../models/avatars';
|
|
|
|
|
import AvatarsOld from '../models/avatars_old';
|
2019-06-26 17:47:27 -05:00
|
|
|
|
import Boards from '../models/boards';
|
|
|
|
|
import CardComments from '../models/cardComments';
|
|
|
|
|
import Cards from '../models/cards';
|
|
|
|
|
import ChecklistItems from '../models/checklistItems';
|
|
|
|
|
import Checklists from '../models/checklists';
|
|
|
|
|
import CustomFields from '../models/customFields';
|
|
|
|
|
import Integrations from '../models/integrations';
|
|
|
|
|
import InvitationCodes from '../models/invitationCodes';
|
|
|
|
|
import Lists from '../models/lists';
|
|
|
|
|
import Rules from '../models/rules';
|
|
|
|
|
import Settings from '../models/settings';
|
|
|
|
|
import Swimlanes from '../models/swimlanes';
|
|
|
|
|
import Triggers from '../models/triggers';
|
|
|
|
|
import UnsavedEdits from '../models/unsavedEdits';
|
|
|
|
|
import Users from '../models/users';
|
2020-10-21 12:51:04 -05:00
|
|
|
|
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
// Anytime you change the schema of one of the collection in a non-backward
|
|
|
|
|
// compatible way you have to write a migration in this file using the following
|
|
|
|
|
// API:
|
|
|
|
|
//
|
|
|
|
|
// Migrations.add(name, migrationCallback, optionalOrder);
|
|
|
|
|
|
2015-10-13 14:17:53 +02:00
|
|
|
|
// Note that we have extra migrations defined in `sandstorm.js` that are
|
|
|
|
|
// exclusive to Sandstorm and shouldn’t be executed in the general case.
|
|
|
|
|
// XXX I guess if we had ES6 modules we could
|
|
|
|
|
// `import { isSandstorm } from sandstorm.js` and define the migration here as
|
|
|
|
|
// well, but for now I want to avoid definied too many globals.
|
|
|
|
|
|
2015-05-13 14:50:03 +02:00
|
|
|
|
// In the context of migration functions we don't want to validate database
|
|
|
|
|
// mutation queries against the current (ie, latest) collection schema. Doing
|
|
|
|
|
// that would work at the time we write the migration but would break in the
|
|
|
|
|
// future when we'll update again the concerned collection schema.
|
|
|
|
|
//
|
2015-05-14 12:24:16 +02:00
|
|
|
|
// To prevent this bug we always have to disable the schema validation and
|
|
|
|
|
// argument transformations. We generally use the shorthandlers defined below.
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const noValidate = {
|
2015-05-14 12:24:16 +02:00
|
|
|
|
validate: false,
|
|
|
|
|
filter: false,
|
|
|
|
|
autoConvert: false,
|
|
|
|
|
removeEmptyStrings: false,
|
2015-09-03 23:12:46 +02:00
|
|
|
|
getAutoValues: false,
|
2015-05-14 12:24:16 +02:00
|
|
|
|
};
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const noValidateMulti = { ...noValidate, multi: true };
|
2015-05-13 14:50:03 +02:00
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('board-background-color', () => {
|
|
|
|
|
const defaultColor = '#16A085';
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
background: {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
$exists: false,
|
2015-09-03 23:12:46 +02:00
|
|
|
|
},
|
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
background: {
|
|
|
|
|
type: 'color',
|
|
|
|
|
color: defaultColor,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
|
2022-04-15 13:19:37 -03:00
|
|
|
|
Migrations.add('add-cardcounterlist-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsCardCounterList: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsCardCounterList: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2022-04-16 03:27:33 +03:00
|
|
|
|
/*
|
2022-04-15 13:19:37 -03:00
|
|
|
|
Migrations.add('add-boardmemberlist-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsBoardMemberList: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsBoardMemberList: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2022-04-16 03:27:33 +03:00
|
|
|
|
*/
|
2022-04-15 13:19:37 -03:00
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('lowercase-board-permission', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
['Public', 'Private'].forEach(permission => {
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
Boards.update(
|
2015-09-03 23:12:46 +02:00
|
|
|
|
{ permission },
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
{ $set: { permission: permission.toLowerCase() } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2021-06-25 14:11:53 +03:00
|
|
|
|
/*
|
2015-08-28 09:50:41 +02:00
|
|
|
|
// Security migration: see https://github.com/wekan/wekan/issues/99
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('change-attachments-type-for-non-images', () => {
|
|
|
|
|
const newTypeForNonImage = 'application/octet-stream';
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Attachments.find().forEach(file => {
|
2020-05-25 17:54:51 +03:00
|
|
|
|
if (!file.isImage()) {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Attachments.update(
|
|
|
|
|
file._id,
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
'original.type': newTypeForNonImage,
|
|
|
|
|
'copies.attachments.type': newTypeForNonImage,
|
|
|
|
|
},
|
2015-09-03 23:12:46 +02:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('card-covers', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Cards.find().forEach(card => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
const cover = Attachments.findOne({ cardId: card._id, cover: true });
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
if (cover) {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(card._id, { $set: { coverId: cover._id } }, noValidate);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
}
|
|
|
|
|
});
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Attachments.update({}, { $unset: { cover: '' } }, noValidateMulti);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
|
2021-06-25 14:11:53 +03:00
|
|
|
|
*/
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('use-css-class-for-boards-colors', () => {
|
|
|
|
|
const associationTable = {
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
'#27AE60': 'nephritis',
|
|
|
|
|
'#C0392B': 'pomegranate',
|
|
|
|
|
'#2980B9': 'belize',
|
|
|
|
|
'#8E44AD': 'wisteria',
|
|
|
|
|
'#2C3E50': 'midnight',
|
2015-09-03 23:12:46 +02:00
|
|
|
|
'#E67E22': 'pumpkin',
|
2019-07-01 17:23:41 -04:00
|
|
|
|
'#CD5A91': 'moderatepink',
|
|
|
|
|
'#00AECC': 'strongcyan',
|
|
|
|
|
'#4BBF6B': 'limegreen',
|
|
|
|
|
'#2C3E51': 'dark',
|
|
|
|
|
'#27AE61': 'relax',
|
2019-07-06 04:59:17 -04:00
|
|
|
|
'#568BA2': 'corteza',
|
2020-05-16 18:07:38 -03:00
|
|
|
|
'#499BEA': 'clearblue',
|
|
|
|
|
'#596557': 'natural',
|
2020-05-22 18:38:50 -03:00
|
|
|
|
'#2A80B8': 'modern',
|
2020-11-10 07:23:59 +02:00
|
|
|
|
'#2a2a2a': 'moderndark',
|
2022-04-06 22:31:25 +02:00
|
|
|
|
'#222222': 'exodark',
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
};
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Boards.find().forEach(board => {
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const oldBoardColor = board.background.color;
|
|
|
|
|
const newBoardColor = associationTable[oldBoardColor];
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
board._id,
|
|
|
|
|
{
|
|
|
|
|
$set: { color: newBoardColor },
|
|
|
|
|
$unset: { background: '' },
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('denormalize-star-number-per-board', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Boards.find().forEach(board => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
const nStars = Users.find({ 'profile.starredBoards': board._id }).count();
|
|
|
|
|
Boards.update(board._id, { $set: { stars: nStars } }, noValidate);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// We want to keep a trace of former members so we can efficiently publish their
|
|
|
|
|
// infos in the general board publication.
|
2015-09-03 23:12:46 +02:00
|
|
|
|
Migrations.add('add-member-isactive-field', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Boards.find({}, { fields: { members: 1 } }).forEach(board => {
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const allUsersWithSomeActivity = _.chain(
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Activities.find(
|
|
|
|
|
{ boardId: board._id },
|
|
|
|
|
{ fields: { userId: 1 } },
|
|
|
|
|
).fetch(),
|
2019-06-26 17:47:27 -05:00
|
|
|
|
)
|
2017-12-03 04:00:55 +02:00
|
|
|
|
.pluck('userId')
|
|
|
|
|
.uniq()
|
|
|
|
|
.value();
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const currentUsers = _.pluck(board.members, 'userId');
|
|
|
|
|
const formerUsers = _.difference(allUsersWithSomeActivity, currentUsers);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
|
2015-09-03 23:12:46 +02:00
|
|
|
|
const newMemberSet = [];
|
2019-06-28 12:52:09 -05:00
|
|
|
|
board.members.forEach(member => {
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
member.isActive = true;
|
|
|
|
|
newMemberSet.push(member);
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
|
formerUsers.forEach(userId => {
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
newMemberSet.push({
|
2015-09-03 23:12:46 +02:00
|
|
|
|
userId,
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
isAdmin: false,
|
2015-09-03 23:12:46 +02:00
|
|
|
|
isActive: false,
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
});
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(board._id, { $set: { members: newMemberSet } }, noValidate);
|
Renaissance
_,,ad8888888888bba,_
,ad88888I888888888888888ba,
,88888888I88888888888888888888a,
,d888888888I8888888888888888888888b,
d88888PP"""" ""YY88888888888888888888b,
,d88"'__,,--------,,,,.;ZZZY8888888888888,
,8IIl'" ;;l"ZZZIII8888888888,
,I88l;' ;lZZZZZ888III8888888,
,II88Zl;. ;llZZZZZ888888I888888,
,II888Zl;. .;;;;;lllZZZ888888I8888b
,II8888Z;; `;;;;;''llZZ8888888I8888,
II88888Z;' .;lZZZ8888888I888b
II88888Z; _,aaa, .,aaaaa,__.l;llZZZ88888888I888
II88888IZZZZZZZZZ, .ZZZZZZZZZZZZZZ;llZZ88888888I888,
II88888IZZ<'(@@>Z| |ZZZ<'(@@>ZZZZ;;llZZ888888888I88I
,II88888; `""" ;| |ZZ; `""" ;;llZ8888888888I888
II888888l `;; .;llZZ8888888888I888,
,II888888Z; ;;; .;;llZZZ8888888888I888I
III888888Zl; .., `;; ,;;lllZZZ88888888888I888
II88888888Z;;...;(_ _) ,;;;llZZZZ88888888888I888,
II88888888Zl;;;;;' `--'Z;. .,;;;;llZZZZ88888888888I888b
]I888888888Z;;;;' ";llllll;..;;;lllZZZZ88888888888I8888,
II888888888Zl.;;"Y88bd888P";;,..;lllZZZZZ88888888888I8888I
II8888888888Zl;.; `"PPP";;;,..;lllZZZZZZZ88888888888I88888
II888888888888Zl;;. `;;;l;;;;lllZZZZZZZZW88888888888I88888
`II8888888888888Zl;. ,;;lllZZZZZZZZWMZ88888888888I88888
II8888888888888888ZbaalllZZZZZZZZZWWMZZZ8888888888I888888,
`II88888888888888888b"WWZZZZZWWWMMZZZZZZI888888888I888888b
`II88888888888888888;ZZMMMMMMZZZZZZZZllI888888888I8888888
`II8888888888888888 `;lZZZZZZZZZZZlllll888888888I8888888,
II8888888888888888, `;lllZZZZllllll;;.Y88888888I8888888b,
,II8888888888888888b .;;lllllll;;;.;..88888888I88888888b,
II888888888888888PZI;. .`;;;.;;;..; ...88888888I8888888888,
II888888888888PZ;;';;. ;. .;. .;. .. Y8888888I88888888888b,
,II888888888PZ;;' `8888888I8888888888888b,
II888888888' 888888I8888888888888888
,II888888888 ,888888I8888888888888888
,d88888888888 d888888I8888888888ZZZZZZ
,ad888888888888I 8888888I8888ZZZZZZZZZZZZ
888888888888888' 888888IZZZZZZZZZZZZZZZZZ
8888888888P'8P' Y888ZZZZZZZZZZZZZZZZZZZZ
888888888, " ,ZZZZZZZZZZZZZZZZZZZZZZZ
8888888888, ,ZZZZZZZZZZZZZZZZZZZZZZZZZZ
888888888888a, _ ,ZZZZZZZZZZZZZZZZZZZZ88888888
888888888888888ba,_d' ,ZZZZZZZZZZZZZZZZZ8888888888888
8888888888888888888888bbbaaa,,,______,ZZZZZZZZZZZZZZZ88888888888888888
88888888888888888888888888888888888ZZZZZZZZZZZZZZZ88888888888888888888
8888888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888
888888888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888888888
8888888888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888
88888888888888888888888888888ZZZZZZZZZZZZZZ888888888888888888888888888
8888888888888888888888888888ZZZZZZZZZZZZZZ88888888888888888 Normand 8
88888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888 Veilleux 8
8888888888888888888888888ZZZZZZZZZZZZZZ8888888888888888888888888888888
2015-05-12 19:20:58 +02:00
|
|
|
|
});
|
|
|
|
|
});
|
2017-09-22 22:35:07 +01:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-sort-checklists', () => {
|
2018-07-06 11:33:13 +03:00
|
|
|
|
Checklists.find().forEach((checklist, index) => {
|
2017-09-22 22:35:07 +01:00
|
|
|
|
if (!checklist.hasOwnProperty('sort')) {
|
|
|
|
|
Checklists.direct.update(
|
|
|
|
|
checklist._id,
|
2017-09-24 02:09:21 +01:00
|
|
|
|
{ $set: { sort: index } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2017-09-22 22:35:07 +01:00
|
|
|
|
);
|
|
|
|
|
}
|
2018-06-14 19:03:44 +03:00
|
|
|
|
checklist.items.forEach((item, index) => {
|
2017-09-22 22:35:07 +01:00
|
|
|
|
if (!item.hasOwnProperty('sort')) {
|
|
|
|
|
Checklists.direct.update(
|
2017-09-23 01:02:44 +01:00
|
|
|
|
{ _id: checklist._id, 'items._id': item._id },
|
|
|
|
|
{ $set: { 'items.$.sort': index } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2017-09-22 22:35:07 +01:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-01-22 15:10:26 -03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-swimlanes', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Boards.find().forEach(board => {
|
2018-06-25 22:01:02 +03:00
|
|
|
|
const swimlaneId = board.getDefaultSwimline()._id;
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Cards.find({ boardId: board._id }).forEach(card => {
|
2018-01-22 15:10:26 -03:00
|
|
|
|
if (!card.hasOwnProperty('swimlaneId')) {
|
|
|
|
|
Cards.direct.update(
|
2018-05-18 15:20:20 +03:00
|
|
|
|
{ _id: card._id },
|
|
|
|
|
{ $set: { swimlaneId } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2018-01-22 15:10:26 -03:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-01-22 16:54:19 -03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-views', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Boards.find().forEach(board => {
|
2018-01-22 16:54:19 -03:00
|
|
|
|
if (!board.hasOwnProperty('view')) {
|
|
|
|
|
Boards.direct.update(
|
2018-05-18 15:20:20 +03:00
|
|
|
|
{ _id: board._id },
|
|
|
|
|
{ $set: { view: 'board-view-swimlanes' } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2018-01-22 16:54:19 -03:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-03-19 00:25:19 -03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-checklist-items', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Checklists.find().forEach(checklist => {
|
2018-03-19 00:25:19 -03:00
|
|
|
|
// Create new items
|
2018-03-19 15:03:44 -03:00
|
|
|
|
_.sortBy(checklist.items, 'sort').forEach((item, index) => {
|
2018-03-19 00:25:19 -03:00
|
|
|
|
ChecklistItems.direct.insert({
|
2019-06-26 17:47:27 -05:00
|
|
|
|
title: item.title ? item.title : 'Checklist',
|
2018-03-19 15:03:44 -03:00
|
|
|
|
sort: index,
|
2018-03-19 00:25:19 -03:00
|
|
|
|
isFinished: item.isFinished,
|
|
|
|
|
checklistId: checklist._id,
|
|
|
|
|
cardId: checklist.cardId,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Delete old ones
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Checklists.direct.update(
|
|
|
|
|
{ _id: checklist._id },
|
|
|
|
|
{ $unset: { items: 1 } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2018-03-19 00:25:19 -03:00
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
2018-04-16 14:33:53 -03:00
|
|
|
|
|
2018-03-20 00:13:42 -03:00
|
|
|
|
Migrations.add('add-card-types', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Cards.find().forEach(card => {
|
2018-03-20 00:13:42 -03:00
|
|
|
|
Cards.direct.update(
|
|
|
|
|
{ _id: card._id },
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
type: 'cardType-card',
|
|
|
|
|
linkedId: null,
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidate,
|
2018-03-20 00:13:42 -03:00
|
|
|
|
);
|
|
|
|
|
});
|
2018-08-11 00:50:20 +02:00
|
|
|
|
});
|
2018-03-20 00:13:42 -03:00
|
|
|
|
|
2018-05-19 08:58:30 +02:00
|
|
|
|
Migrations.add('add-custom-fields-to-cards', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(
|
|
|
|
|
{
|
|
|
|
|
customFields: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-05-19 08:58:30 +02:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
customFields: [],
|
|
|
|
|
},
|
2018-05-19 08:58:30 +02:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-05-19 08:58:30 +02:00
|
|
|
|
});
|
2018-06-06 13:19:53 +00:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-requester-field', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(
|
|
|
|
|
{
|
|
|
|
|
requestedBy: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-06 13:19:53 +00:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
requestedBy: '',
|
|
|
|
|
},
|
2018-06-06 13:19:53 +00:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-06 13:19:53 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-assigner-field', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(
|
|
|
|
|
{
|
|
|
|
|
assignedBy: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-06 13:19:53 +00:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
assignedBy: '',
|
|
|
|
|
},
|
2018-06-06 13:19:53 +00:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-06 13:19:53 +00:00
|
|
|
|
});
|
|
|
|
|
|
2018-06-19 00:42:54 +03:00
|
|
|
|
Migrations.add('add-parent-field-to-cards', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(
|
|
|
|
|
{
|
|
|
|
|
parentId: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-19 00:42:54 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
parentId: '',
|
|
|
|
|
},
|
2018-06-19 00:42:54 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-19 00:42:54 +03:00
|
|
|
|
});
|
2018-06-23 23:22:38 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-subtasks-boards', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
subtasksDefaultBoardId: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-23 23:22:38 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
subtasksDefaultBoardId: null,
|
|
|
|
|
subtasksDefaultListId: null,
|
|
|
|
|
},
|
2018-06-23 23:22:38 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-23 23:22:38 +03:00
|
|
|
|
});
|
2018-06-24 00:21:23 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-subtasks-sort', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
subtaskSort: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-24 00:21:23 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
subtaskSort: -1,
|
|
|
|
|
},
|
2018-06-24 00:21:23 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-24 00:21:23 +03:00
|
|
|
|
});
|
|
|
|
|
|
2018-06-25 23:12:20 +03:00
|
|
|
|
Migrations.add('add-subtasks-allowed', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsSubtasks: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-25 23:12:20 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsSubtasks: true,
|
|
|
|
|
},
|
2018-06-26 02:13:31 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-26 02:13:31 +03:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-subtasks-allowed', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
presentParentTask: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-06-26 02:13:31 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
presentParentTask: 'no-parent',
|
|
|
|
|
},
|
2018-06-25 23:12:20 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-06-25 23:12:20 +03:00
|
|
|
|
});
|
2018-10-09 14:14:39 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-authenticationMethod', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Users.update(
|
|
|
|
|
{
|
|
|
|
|
authenticationMethod: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-10-09 14:14:39 +02:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
authenticationMethod: 'password',
|
|
|
|
|
},
|
2018-10-09 14:14:39 +02:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-10-09 14:14:39 +02:00
|
|
|
|
});
|
2018-10-11 16:44:52 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('remove-tag', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Users.update(
|
|
|
|
|
{},
|
|
|
|
|
{
|
|
|
|
|
$unset: {
|
|
|
|
|
'profile.tags': 1,
|
|
|
|
|
},
|
2018-10-11 16:44:52 +02:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-10-11 23:41:50 +03:00
|
|
|
|
});
|
2018-10-12 23:04:09 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('remove-customFields-references-broken', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(
|
|
|
|
|
{ 'customFields.$value': null },
|
|
|
|
|
{
|
|
|
|
|
$pull: {
|
|
|
|
|
customFields: { value: null },
|
|
|
|
|
},
|
2018-10-12 23:22:41 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-10-12 23:04:09 +03:00
|
|
|
|
});
|
2018-10-24 11:39:45 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-product-name', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
productName: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-10-24 11:39:45 +03:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
productName: '',
|
|
|
|
|
},
|
2018-10-24 11:39:45 +03:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-10-24 11:39:45 +03:00
|
|
|
|
});
|
2018-11-20 02:38:00 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-hide-logo', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideLogo: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2018-11-20 02:38:00 +02:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideLogo: false,
|
|
|
|
|
},
|
2018-11-20 02:38:00 +02:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2018-11-20 02:38:00 +02:00
|
|
|
|
});
|
2018-12-16 22:21:16 +02:00
|
|
|
|
|
2022-09-16 11:02:25 -03:00
|
|
|
|
Migrations.add('add-hide-card-counter-list', () => {
|
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideCardCounterList: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideCardCounterList: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-hide-board-member-list', () => {
|
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideBoardMemberList: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideBoardMemberList: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2019-02-01 19:00:44 +01:00
|
|
|
|
Migrations.add('add-displayAuthenticationMethod', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
displayAuthenticationMethod: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-02-01 19:00:44 +01:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
displayAuthenticationMethod: true,
|
|
|
|
|
},
|
2019-02-01 19:00:44 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-01 19:00:44 +01:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-defaultAuthenticationMethod', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
defaultAuthenticationMethod: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-02-01 19:00:44 +01:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
defaultAuthenticationMethod: 'password',
|
|
|
|
|
},
|
2019-02-01 19:00:44 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-01 21:26:04 +02:00
|
|
|
|
});
|
2019-02-24 12:55:34 +01:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-templates', () => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
type: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
type: 'board',
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
|
|
|
|
Swimlanes.update(
|
|
|
|
|
{
|
|
|
|
|
type: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
type: 'swimlane',
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
|
|
|
|
Lists.update(
|
|
|
|
|
{
|
|
|
|
|
type: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
swimlaneId: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
type: 'list',
|
|
|
|
|
swimlaneId: '',
|
|
|
|
|
},
|
2019-02-24 12:55:34 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-24 12:55:34 +01:00
|
|
|
|
Users.find({
|
|
|
|
|
'profile.templatesBoardId': {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
}).forEach(user => {
|
2019-02-24 12:55:34 +01:00
|
|
|
|
// Create board and swimlanes
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Boards.insert(
|
|
|
|
|
{
|
|
|
|
|
title: TAPi18n.__('templates'),
|
|
|
|
|
permission: 'private',
|
2019-02-24 12:55:34 +01:00
|
|
|
|
type: 'template-container',
|
2019-06-26 17:47:27 -05:00
|
|
|
|
members: [
|
|
|
|
|
{
|
|
|
|
|
userId: user._id,
|
|
|
|
|
isAdmin: true,
|
|
|
|
|
isActive: true,
|
|
|
|
|
isNoComments: false,
|
|
|
|
|
isCommentOnly: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
(err, boardId) => {
|
|
|
|
|
// Insert the reference to our templates board
|
|
|
|
|
Users.update(user._id, {
|
|
|
|
|
$set: { 'profile.templatesBoardId': boardId },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Insert the card templates swimlane
|
|
|
|
|
Swimlanes.insert(
|
|
|
|
|
{
|
|
|
|
|
title: TAPi18n.__('card-templates-swimlane'),
|
|
|
|
|
boardId,
|
|
|
|
|
sort: 1,
|
|
|
|
|
type: 'template-container',
|
|
|
|
|
},
|
|
|
|
|
(err, swimlaneId) => {
|
|
|
|
|
// Insert the reference to out card templates swimlane
|
|
|
|
|
Users.update(user._id, {
|
|
|
|
|
$set: { 'profile.cardTemplatesSwimlaneId': swimlaneId },
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-24 12:55:34 +01:00
|
|
|
|
|
2019-06-26 17:47:27 -05:00
|
|
|
|
// Insert the list templates swimlane
|
|
|
|
|
Swimlanes.insert(
|
|
|
|
|
{
|
|
|
|
|
title: TAPi18n.__('list-templates-swimlane'),
|
|
|
|
|
boardId,
|
|
|
|
|
sort: 2,
|
|
|
|
|
type: 'template-container',
|
|
|
|
|
},
|
|
|
|
|
(err, swimlaneId) => {
|
|
|
|
|
// Insert the reference to out list templates swimlane
|
|
|
|
|
Users.update(user._id, {
|
|
|
|
|
$set: { 'profile.listTemplatesSwimlaneId': swimlaneId },
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-24 12:55:34 +01:00
|
|
|
|
|
2019-06-26 17:47:27 -05:00
|
|
|
|
// Insert the board templates swimlane
|
|
|
|
|
Swimlanes.insert(
|
|
|
|
|
{
|
|
|
|
|
title: TAPi18n.__('board-templates-swimlane'),
|
|
|
|
|
boardId,
|
|
|
|
|
sort: 3,
|
|
|
|
|
type: 'template-container',
|
|
|
|
|
},
|
|
|
|
|
(err, swimlaneId) => {
|
|
|
|
|
// Insert the reference to out board templates swimlane
|
|
|
|
|
Users.update(user._id, {
|
|
|
|
|
$set: { 'profile.boardTemplatesSwimlaneId': swimlaneId },
|
|
|
|
|
});
|
2019-06-28 12:52:09 -05:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-06-28 12:52:09 -05:00
|
|
|
|
},
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-02-24 12:55:34 +01:00
|
|
|
|
});
|
|
|
|
|
});
|
2019-03-07 00:13:21 +01:00
|
|
|
|
|
2019-03-11 22:30:16 +01:00
|
|
|
|
Migrations.add('fix-circular-reference_', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
Cards.find().forEach(card => {
|
2019-03-07 00:13:21 +01:00
|
|
|
|
if (card.parentId === card._id) {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Cards.update(card._id, { $set: { parentId: '' } }, noValidateMulti);
|
2019-03-07 00:13:21 +01:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2019-03-08 23:39:33 +01:00
|
|
|
|
|
|
|
|
|
Migrations.add('mutate-boardIds-in-customfields', () => {
|
2019-06-28 12:52:09 -05:00
|
|
|
|
CustomFields.find().forEach(cf => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
CustomFields.update(
|
|
|
|
|
cf,
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
boardIds: [cf.boardId],
|
|
|
|
|
},
|
|
|
|
|
$unset: {
|
|
|
|
|
boardId: '',
|
|
|
|
|
},
|
2019-03-08 23:39:33 +01:00
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
|
noValidateMulti,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
);
|
2019-03-08 23:39:33 +01:00
|
|
|
|
});
|
|
|
|
|
});
|
2019-06-26 17:47:27 -05:00
|
|
|
|
|
|
|
|
|
const modifiedAtTables = [
|
|
|
|
|
AccountSettings,
|
2021-08-27 16:25:44 +02:00
|
|
|
|
TableVisibilityModeSettings,
|
2019-06-26 17:47:27 -05:00
|
|
|
|
Actions,
|
|
|
|
|
Activities,
|
|
|
|
|
Announcements,
|
|
|
|
|
Boards,
|
|
|
|
|
CardComments,
|
|
|
|
|
Cards,
|
|
|
|
|
ChecklistItems,
|
|
|
|
|
Checklists,
|
|
|
|
|
CustomFields,
|
|
|
|
|
Integrations,
|
|
|
|
|
InvitationCodes,
|
|
|
|
|
Lists,
|
|
|
|
|
Rules,
|
|
|
|
|
Settings,
|
|
|
|
|
Swimlanes,
|
|
|
|
|
Triggers,
|
|
|
|
|
UnsavedEdits,
|
|
|
|
|
Users,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-missing-created-and-modified', () => {
|
|
|
|
|
Promise.all(
|
2019-06-28 12:52:09 -05:00
|
|
|
|
modifiedAtTables.map(db =>
|
2019-06-26 17:47:27 -05:00
|
|
|
|
db
|
|
|
|
|
.rawCollection()
|
2022-04-22 16:32:28 +03:00
|
|
|
|
.updateMany(
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{ modifiedAt: { $exists: false } },
|
|
|
|
|
{ $set: { modifiedAt: new Date() } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
{ multi: true },
|
2019-06-26 17:47:27 -05:00
|
|
|
|
)
|
|
|
|
|
.then(() =>
|
|
|
|
|
db
|
|
|
|
|
.rawCollection()
|
2022-04-22 16:32:28 +03:00
|
|
|
|
.updateMany(
|
2019-06-26 17:47:27 -05:00
|
|
|
|
{ createdAt: { $exists: false } },
|
|
|
|
|
{ $set: { createdAt: new Date() } },
|
2019-06-28 12:52:09 -05:00
|
|
|
|
{ multi: true },
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2019-06-26 17:47:27 -05:00
|
|
|
|
)
|
|
|
|
|
.then(() => {
|
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
console.info('Successfully added createdAt and updatedAt to all tables');
|
|
|
|
|
})
|
2019-06-28 12:52:09 -05:00
|
|
|
|
.catch(e => {
|
2019-06-26 17:47:27 -05:00
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
console.error(e);
|
|
|
|
|
});
|
|
|
|
|
});
|
2019-09-05 12:29:45 -05:00
|
|
|
|
|
|
|
|
|
Migrations.add('fix-incorrect-dates', () => {
|
|
|
|
|
const tables = [
|
|
|
|
|
AccountSettings,
|
2021-08-27 16:25:44 +02:00
|
|
|
|
TableVisibilityModeSettings,
|
2019-09-05 12:29:45 -05:00
|
|
|
|
Actions,
|
|
|
|
|
Activities,
|
|
|
|
|
Announcements,
|
|
|
|
|
Boards,
|
|
|
|
|
CardComments,
|
|
|
|
|
Cards,
|
|
|
|
|
ChecklistItems,
|
|
|
|
|
Checklists,
|
|
|
|
|
CustomFields,
|
|
|
|
|
Integrations,
|
|
|
|
|
InvitationCodes,
|
|
|
|
|
Lists,
|
|
|
|
|
Rules,
|
|
|
|
|
Settings,
|
|
|
|
|
Swimlanes,
|
|
|
|
|
Triggers,
|
|
|
|
|
UnsavedEdits,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// Dates were previously created with Date.now() which is a number, not a date
|
|
|
|
|
tables.forEach(t =>
|
|
|
|
|
t
|
|
|
|
|
.rawCollection()
|
|
|
|
|
.find({ $or: [{ createdAt: { $type: 1 } }, { updatedAt: { $type: 1 } }] })
|
|
|
|
|
.forEach(({ _id, createdAt, updatedAt }) => {
|
2022-04-22 16:32:28 +03:00
|
|
|
|
t.rawCollection().updateMany(
|
2019-09-05 12:29:45 -05:00
|
|
|
|
{ _id },
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
createdAt: new Date(createdAt),
|
|
|
|
|
updatedAt: new Date(updatedAt),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
});
|
2019-11-14 03:00:14 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-assignee', () => {
|
|
|
|
|
Cards.update(
|
|
|
|
|
{
|
|
|
|
|
assignees: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
assignees: [],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
|
|
2019-11-19 14:09:36 +02:00
|
|
|
|
Migrations.add('add-profile-showDesktopDragHandles', () => {
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
|
Users.update(
|
|
|
|
|
{
|
2019-11-19 14:09:36 +02:00
|
|
|
|
'profile.showDesktopDragHandles': {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
'profile.showDesktopDragHandles': false,
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2019-11-19 14:09:36 +02:00
|
|
|
|
Migrations.add('add-profile-hiddenMinicardLabelText', () => {
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
|
Users.update(
|
|
|
|
|
{
|
2019-11-19 14:09:36 +02:00
|
|
|
|
'profile.hiddenMinicardLabelText': {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
'profile.hiddenMinicardLabelText': false,
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-02-05 01:17:15 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-receiveddate-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsReceivedDate: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsReceivedDate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-startdate-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsStartDate: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsStartDate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-duedate-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsDueDate: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsDueDate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-enddate-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsEndDate: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsEndDate: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-members-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsMembers: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsMembers: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-assignee-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsAssignee: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsAssignee: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-labels-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsLabels: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsLabels: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-checklists-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsChecklists: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsChecklists: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-attachments-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsAttachments: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsAttachments: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-comments-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsComments: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsComments: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-assigned-by-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsAssignedBy: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsAssignedBy: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-requested-by-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsRequestedBy: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsRequestedBy: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-02-07 13:58:43 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-activities-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsActivities: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsActivities: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-02-12 02:08:29 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-description-title-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsDescriptionTitle: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsDescriptionTitle: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-description-text-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsDescriptionText: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsDescriptionText: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-04-19 10:51:58 +03:00
|
|
|
|
|
2022-04-05 17:00:39 -03:00
|
|
|
|
Migrations.add('add-description-text-allowed-on-minicard', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsDescriptionTextOnMinicard: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsDescriptionTextOnMinicard: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2020-04-19 10:51:58 +03:00
|
|
|
|
Migrations.add('add-sort-field-to-boards', () => {
|
|
|
|
|
Boards.find().forEach((board, index) => {
|
2020-04-22 21:00:31 +03:00
|
|
|
|
if (!board.hasOwnProperty('sort')) {
|
|
|
|
|
Boards.direct.update(board._id, { $set: { sort: index } }, noValidate);
|
2020-04-19 10:51:58 +03:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-06-08 17:28:53 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-default-profile-view', () => {
|
|
|
|
|
Users.find().forEach(user => {
|
|
|
|
|
if (!user.hasOwnProperty('profile.boardView')) {
|
|
|
|
|
// Set default view
|
|
|
|
|
Users.direct.update(
|
|
|
|
|
{ _id: user._id },
|
|
|
|
|
{ $set: { 'profile.boardView': 'board-view-swimlanes' } },
|
|
|
|
|
noValidate,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-09-18 18:45:48 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-hide-logo-by-default', () => {
|
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideLogo: {
|
|
|
|
|
hideLogo: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideLogo: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2021-08-02 21:41:30 +02:00
|
|
|
|
|
2022-09-16 11:02:25 -03:00
|
|
|
|
Migrations.add('add-hide-card-counter-list-by-default', () => {
|
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideCardCounterList: {
|
|
|
|
|
hideCardCounterList: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideCardCounterList: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('add-hide-board-member-list-by-default', () => {
|
|
|
|
|
Settings.update(
|
|
|
|
|
{
|
|
|
|
|
hideBoardMemberList: {
|
|
|
|
|
hideBoardMember: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
hideBoardMemberList: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2021-08-02 21:41:30 +02:00
|
|
|
|
Migrations.add('add-card-number-allowed', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsCardNumber: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsCardNumber: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Migrations.add('assign-boardwise-card-numbers', () => {
|
|
|
|
|
Boards.find().forEach(board => {
|
2021-08-02 22:06:34 +02:00
|
|
|
|
let nextCardNumber = board.getNextCardNumber();
|
2021-08-02 21:41:30 +02:00
|
|
|
|
Cards.find(
|
|
|
|
|
{
|
|
|
|
|
boardId: board._id,
|
|
|
|
|
cardNumber: {
|
|
|
|
|
$exists: false
|
|
|
|
|
}
|
2021-08-02 22:06:34 +02:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sort: { createdAt: 1 }
|
2021-08-02 21:41:30 +02:00
|
|
|
|
}
|
|
|
|
|
).forEach(card => {
|
2021-08-02 22:06:34 +02:00
|
|
|
|
Cards.update(
|
|
|
|
|
card._id,
|
|
|
|
|
{ $set: { cardNumber: nextCardNumber } },
|
|
|
|
|
noValidate);
|
2021-08-02 21:41:30 +02:00
|
|
|
|
nextCardNumber++;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
});
|
2022-02-03 08:46:25 +01:00
|
|
|
|
|
|
|
|
|
Migrations.add('add-card-details-show-lists', () => {
|
|
|
|
|
Boards.update(
|
|
|
|
|
{
|
|
|
|
|
allowsShowLists: {
|
|
|
|
|
$exists: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$set: {
|
|
|
|
|
allowsShowLists: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
noValidateMulti,
|
|
|
|
|
);
|
|
|
|
|
});
|
2020-09-14 01:21:50 -05:00
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
Migrations.add('migrate-attachments-collectionFS-to-ostrioFiles', () => {
|
2023-02-27 16:58:12 +02:00
|
|
|
|
Meteor.settings.public.ostrioFilesMigrationInProgress = "true";
|
2020-10-20 12:55:28 -05:00
|
|
|
|
AttachmentsOld.find().forEach(function(fileObj) {
|
|
|
|
|
const newFileName = fileObj.name();
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const storagePath = Attachments.storagePath({});
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
|
|
|
|
|
// This is "example" variable, change it to the userId that you might be using.
|
|
|
|
|
const userId = fileObj.userId;
|
|
|
|
|
|
|
|
|
|
const fileType = fileObj.type();
|
|
|
|
|
const fileSize = fileObj.size();
|
|
|
|
|
const fileId = fileObj._id;
|
|
|
|
|
|
|
|
|
|
const readStream = fileObj.createReadStream('attachments');
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const writeStream = fs.createWriteStream(filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
writeStream.on('error', function(err) {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Writing error: ', err, filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Once we have a file, then upload it to our new data storage
|
|
|
|
|
readStream.on('end', () => {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Ended: ', filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
// UserFiles is the new Meteor-Files/FilesCollection collection instance
|
|
|
|
|
|
|
|
|
|
Attachments.addFile(
|
2022-01-30 15:26:11 +03:00
|
|
|
|
filePath,
|
2020-09-14 01:21:50 -05:00
|
|
|
|
{
|
2020-10-20 12:55:28 -05:00
|
|
|
|
fileName: newFileName,
|
|
|
|
|
type: fileType,
|
|
|
|
|
meta: {
|
|
|
|
|
boardId: fileObj.boardId,
|
|
|
|
|
cardId: fileObj.cardId,
|
|
|
|
|
listId: fileObj.listId,
|
|
|
|
|
swimlaneId: fileObj.swimlaneId,
|
2022-03-30 07:04:46 +02:00
|
|
|
|
source: 'import'
|
2020-09-14 01:21:50 -05:00
|
|
|
|
},
|
2020-10-20 12:55:28 -05:00
|
|
|
|
userId,
|
|
|
|
|
size: fileSize,
|
|
|
|
|
fileId,
|
2020-09-14 01:21:50 -05:00
|
|
|
|
},
|
2020-10-20 12:55:28 -05:00
|
|
|
|
(err, fileRef) => {
|
|
|
|
|
if (err) {
|
|
|
|
|
console.log(err);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
} else {
|
2020-10-20 12:55:28 -05:00
|
|
|
|
console.log('File Inserted: ', fileRef._id);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
// Set the userId again
|
|
|
|
|
Attachments.update({ _id: fileRef._id }, { $set: { userId } });
|
|
|
|
|
fileObj.remove();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
true,
|
|
|
|
|
); // proceedAfterUpload
|
2020-09-14 01:21:50 -05:00
|
|
|
|
});
|
2020-10-20 12:55:28 -05:00
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
readStream.on('error', error => {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Error: ', filePath, error);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
readStream.pipe(writeStream);
|
|
|
|
|
});
|
2023-02-27 16:58:12 +02:00
|
|
|
|
Meteor.settings.public.ostrioFilesMigrationInProgress = "false";
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
2020-10-21 12:39:49 -05:00
|
|
|
|
|
2020-10-21 12:51:04 -05:00
|
|
|
|
Migrations.add('migrate-avatars-collectionFS-to-ostrioFiles', () => {
|
2023-02-27 16:58:12 +02:00
|
|
|
|
Meteor.settings.public.ostrioFilesMigrationInProgress = "true";
|
2020-10-20 12:55:28 -05:00
|
|
|
|
AvatarsOld.find().forEach(function(fileObj) {
|
|
|
|
|
const newFileName = fileObj.name();
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const storagePath = Avatars.storagePath({});
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const filePath = path.join(storagePath, `${fileObj._id}-${newFileName}`);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
|
|
|
|
|
// This is "example" variable, change it to the userId that you might be using.
|
|
|
|
|
const userId = fileObj.userId;
|
|
|
|
|
|
|
|
|
|
const fileType = fileObj.type();
|
|
|
|
|
const fileSize = fileObj.size();
|
|
|
|
|
const fileId = fileObj._id;
|
|
|
|
|
|
|
|
|
|
const readStream = fileObj.createReadStream('avatars');
|
2022-01-30 15:26:11 +03:00
|
|
|
|
const writeStream = fs.createWriteStream(filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
writeStream.on('error', function(err) {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Writing error: ', err, filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Once we have a file, then upload it to our new data storage
|
|
|
|
|
readStream.on('end', () => {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Ended: ', filePath);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
// UserFiles is the new Meteor-Files/FilesCollection collection instance
|
|
|
|
|
|
|
|
|
|
Avatars.addFile(
|
2022-01-30 15:26:11 +03:00
|
|
|
|
filePath,
|
2020-10-20 12:55:28 -05:00
|
|
|
|
{
|
|
|
|
|
fileName: newFileName,
|
|
|
|
|
type: fileType,
|
|
|
|
|
meta: {
|
|
|
|
|
boardId: fileObj.boardId,
|
|
|
|
|
cardId: fileObj.cardId,
|
|
|
|
|
listId: fileObj.listId,
|
|
|
|
|
swimlaneId: fileObj.swimlaneId,
|
|
|
|
|
},
|
|
|
|
|
userId,
|
|
|
|
|
size: fileSize,
|
|
|
|
|
fileId,
|
2020-09-14 01:21:50 -05:00
|
|
|
|
},
|
2020-10-20 12:55:28 -05:00
|
|
|
|
(err, fileRef) => {
|
|
|
|
|
if (err) {
|
|
|
|
|
console.log(err);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
} else {
|
2020-10-21 09:39:00 -05:00
|
|
|
|
console.log('File Inserted: ', newFileName, fileRef._id);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
// Set the userId again
|
|
|
|
|
Avatars.update({ _id: fileRef._id }, { $set: { userId } });
|
2020-10-21 09:39:00 -05:00
|
|
|
|
Users.find().forEach(user => {
|
|
|
|
|
const old_url = fileObj.url();
|
|
|
|
|
new_url = Avatars.findOne({ _id: fileRef._id }).link(
|
|
|
|
|
'original',
|
|
|
|
|
'/',
|
|
|
|
|
);
|
2023-02-27 16:31:43 +02:00
|
|
|
|
if (user.profile.avatarUrl !== undefined) {
|
|
|
|
|
if (user.profile.avatarUrl.startsWith(old_url)) {
|
|
|
|
|
// Set avatar url to new url
|
|
|
|
|
Users.direct.update(
|
|
|
|
|
{ _id: user._id },
|
|
|
|
|
{ $set: { 'profile.avatarUrl': new_url } },
|
|
|
|
|
noValidate,
|
|
|
|
|
);
|
|
|
|
|
console.log('User avatar updated: ', user._id, new_url);
|
|
|
|
|
}
|
2020-10-21 09:39:00 -05:00
|
|
|
|
}
|
|
|
|
|
});
|
2020-10-20 12:55:28 -05:00
|
|
|
|
fileObj.remove();
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-10-21 09:39:00 -05:00
|
|
|
|
true, // proceedAfterUpload
|
|
|
|
|
);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
readStream.on('error', error => {
|
2022-01-30 15:26:11 +03:00
|
|
|
|
console.log('Error: ', filePath, error);
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
|
|
|
|
|
2020-10-20 12:55:28 -05:00
|
|
|
|
readStream.pipe(writeStream);
|
|
|
|
|
});
|
2023-02-27 16:58:12 +02:00
|
|
|
|
Meteor.settings.public.ostrioFilesMigrationInProgress = "false";
|
2020-10-20 12:55:28 -05:00
|
|
|
|
});
|
2022-04-19 15:41:44 +03:00
|
|
|
|
|
|
|
|
|
Migrations.add('migrate-attachment-drop-index-cardId', () => {
|
|
|
|
|
try {
|
|
|
|
|
Attachments.collection._dropIndex({'cardId': 1});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
}
|
|
|
|
|
});
|
2022-04-03 23:53:18 +02:00
|
|
|
|
|
|
|
|
|
Migrations.add('migrate-attachment-migration-fix-source-import', () => {
|
|
|
|
|
// there was an error at first versions, so source was import, instead of import
|
|
|
|
|
Attachments.update(
|
|
|
|
|
{"meta.source":"import,"},
|
|
|
|
|
{$set:{"meta.source":"import"}},
|
|
|
|
|
noValidateMulti
|
|
|
|
|
);
|
|
|
|
|
});
|