1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00
planka/server/api/models/Board.js

68 lines
1.6 KiB
JavaScript
Raw Normal View History

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
*/
const Types = {
KANBAN: 'kanban',
COLLECTION: 'collection',
};
const ImportTypes = {
TRELLO: 'trello',
};
2019-08-31 04:07:25 +05:00
module.exports = {
Types,
ImportTypes,
2019-08-31 04:07:25 +05:00
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
type: {
type: 'string',
isIn: Object.values(Types),
required: true,
},
2019-08-31 04:07:25 +05:00
position: {
type: 'number',
required: true,
2019-08-31 04:07:25 +05:00
},
name: {
type: 'string',
required: true,
2019-08-31 04:07:25 +05:00
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
projectId: {
model: 'Project',
required: true,
columnName: 'project_id',
2019-08-31 04:07:25 +05:00
},
memberUsers: {
collection: 'User',
via: 'boardId',
through: 'BoardMembership',
},
2019-08-31 04:07:25 +05:00
lists: {
collection: 'List',
via: 'boardId',
2019-08-31 04:07:25 +05:00
},
labels: {
collection: 'Label',
via: 'boardId',
},
},
2019-08-31 04:07:25 +05:00
};