2019-08-31 04:07:25 +05:00
|
|
|
/**
|
|
|
|
* Board.js
|
|
|
|
*
|
|
|
|
* @description :: A model definition represents a database table/collection.
|
|
|
|
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
|
|
|
|
*/
|
|
|
|
|
2020-08-04 01:32:46 +05:00
|
|
|
const TYPES = ['kanban', 'collection'];
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
module.exports = {
|
2020-08-04 01:32:46 +05:00
|
|
|
TYPES,
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
attributes: {
|
|
|
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
|
|
|
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
|
|
|
|
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
|
|
|
|
|
2020-08-04 01:32:46 +05:00
|
|
|
type: {
|
|
|
|
type: 'string',
|
|
|
|
isIn: TYPES,
|
|
|
|
required: true,
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
position: {
|
|
|
|
type: 'number',
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
|
|
|
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
|
|
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
|
|
|
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
|
|
|
|
|
|
|
|
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
|
|
|
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
|
|
|
|
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
|
|
|
|
|
|
|
projectId: {
|
|
|
|
model: 'Project',
|
|
|
|
required: true,
|
2019-11-05 18:01:42 +05:00
|
|
|
columnName: 'project_id',
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
lists: {
|
|
|
|
collection: 'List',
|
2019-11-05 18:01:42 +05:00
|
|
|
via: 'boardId',
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
labels: {
|
|
|
|
collection: 'Label',
|
2019-11-05 18:01:42 +05:00
|
|
|
via: 'boardId',
|
|
|
|
},
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
};
|