river-of-ebooks/api/models/Book.js

37 lines
1.2 KiB
JavaScript
Raw Normal View History

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-07 19:38:28 +00:00
autoIncrement: true
2018-10-31 18:54:58 +00:00
},
2018-11-12 20:39:49 +00:00
source: { type: 'string' },
2018-11-12 20:33:59 +00:00
title: { type: 'string', required: true },
author: { type: 'string' },
version: { type: 'string' },
isbn: { type: 'string' }
2018-10-24 03:13:56 +00:00
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
2018-11-07 20:06:36 +00:00
}
2018-10-24 03:13:56 +00:00
2018-11-07 20:06:36 +00:00
}