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

37 lines
1.1 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-10-24 03:13:56 +00:00
title: {type: 'string', required: true},
author: {type: 'string'},
isbn: {type: 'string'},
version: {type: 'string'},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
},
2018-11-05 15:24:15 +00:00
};