diff options
-rw-r--r-- | models/customFields.js | 6 | ||||
-rw-r--r-- | server/migrations.js | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/models/customFields.js b/models/customFields.js index 6c5fe7c4..38481d8c 100644 --- a/models/customFields.js +++ b/models/customFields.js @@ -71,6 +71,12 @@ if (Meteor.isServer) { Activities.remove({ customFieldId: doc._id, }); + + Cards.update( + {'boardId': doc.boardId, 'customFields._id': doc._id}, + {$pull: {'customFields': {'_id': doc._id}}}, + {multi: true} + ); }); } diff --git a/server/migrations.js b/server/migrations.js index 91c34be2..ac33d836 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -321,3 +321,21 @@ Migrations.add('add-subtasks-allowed', () => { }, }, noValidateMulti); }); + +Migrations.add('remove-tag', () => { + Users.update({ + }, { + $unset: { + 'profile.tags':1, + }, + }, noValidateMulti); +}); + +Migrations.add('remove-customFields-references-broken', () => { + Cards.update({'customFields.$value': null}, + { $pull: { + customFields: {value: null}, + }, + }, noValidateMulti); +}); + |