2018-10-24 03:13:56 +00:00
|
|
|
/**
|
|
|
|
* Book.js
|
|
|
|
*
|
|
|
|
* @description :: A model definition. Represents a database table/collection/etc.
|
|
|
|
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
attributes: {
|
|
|
|
|
|
|
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
|
|
|
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
|
|
|
|
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
|
2018-10-31 18:54:58 +00:00
|
|
|
id: {
|
2018-10-31 21:05:27 +00:00
|
|
|
type: 'number',
|
2018-10-31 18:54:58 +00:00
|
|
|
unique: true,
|
2018-11-12 22:12:16 +00:00
|
|
|
autoIncrement: true,
|
|
|
|
columnName: '_id'
|
2018-10-31 18:54:58 +00:00
|
|
|
},
|
2018-11-20 00:22:41 +00:00
|
|
|
title: { type: 'string', required: true },
|
|
|
|
author: { type: 'string' },
|
|
|
|
isbn: { type: 'string' },
|
|
|
|
version: { type: 'string' }
|
2018-10-24 03:13:56 +00:00
|
|
|
|
|
|
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
|
|
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
|
|
|
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
|
|
|
|
|
|
|
|
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
|
|
|
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
|
|
|
|
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
|
|
|
|
2018-11-20 00:22:41 +00:00
|
|
|
}
|
2018-10-24 03:13:56 +00:00
|
|
|
|
2018-11-07 20:06:36 +00:00
|
|
|
}
|