diff options
-rw-r--r-- | config/models.js | 4 | ||||
-rw-r--r-- | models/cards.js | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/config/models.js b/config/models.js new file mode 100644 index 00000000..d5fe2a04 --- /dev/null +++ b/config/models.js @@ -0,0 +1,4 @@ +module.exports.models = { + connection: 'mongodb', + migrate: 'safe' +} diff --git a/models/cards.js b/models/cards.js index 2c0da093..04348e2f 100644 --- a/models/cards.js +++ b/models/cards.js @@ -6,6 +6,8 @@ Cards = new Mongo.Collection('cards'); Cards.attachSchema(new SimpleSchema({ title: { type: String, + optional: true, + defaultValue: '', }, archived: { type: Boolean, @@ -22,6 +24,8 @@ Cards.attachSchema(new SimpleSchema({ }, listId: { type: String, + optional: true, + defaultValue: '', }, swimlaneId: { type: String, @@ -31,10 +35,14 @@ Cards.attachSchema(new SimpleSchema({ // difficult to manage and less efficient. boardId: { type: String, + optional: true, + defaultValue: '', }, coverId: { type: String, optional: true, + defaultValue: '', + }, createdAt: { type: Date, @@ -49,15 +57,19 @@ Cards.attachSchema(new SimpleSchema({ customFields: { type: [Object], optional: true, + defaultValue: [], }, 'customFields.$': { type: new SimpleSchema({ _id: { type: String, + optional: true, + defaultValue: '', }, value: { type: Match.OneOf(String, Number, Boolean, Date), optional: true, + defaultValue: '', }, }), }, @@ -70,22 +82,28 @@ Cards.attachSchema(new SimpleSchema({ description: { type: String, optional: true, + defaultValue: '' }, requestedBy: { type: String, optional: true, + defaultValue: '', + }, assignedBy: { type: String, optional: true, + defaultValue: '', }, labelIds: { type: [String], optional: true, + defaultValue: '', }, members: { type: [String], optional: true, + defaultValue: [], }, receivedAt: { type: Date, @@ -107,6 +125,7 @@ Cards.attachSchema(new SimpleSchema({ type: Number, decimal: true, optional: true, + defaultValue: 0, }, isOvertime: { type: Boolean, @@ -126,6 +145,7 @@ Cards.attachSchema(new SimpleSchema({ sort: { type: Number, decimal: true, + defaultValue: '', }, subtaskSort: { type: Number, @@ -135,10 +155,12 @@ Cards.attachSchema(new SimpleSchema({ }, type: { type: String, + defaultValue: '', }, linkedId: { type: String, optional: true, + defaultValue: '', }, })); |