mirror of
https://github.com/Ratstail91/sineql-demo.git
synced 2026-05-06 07:40:09 +10:00
Updated the dependencies, adjusted book handler code
This commit is contained in:
@@ -12,7 +12,8 @@ module.exports = sequelize.define('author', {
|
||||
|
||||
name: {
|
||||
type: Sequelize.TEXT,
|
||||
allowNull: true,
|
||||
defaultValue: null
|
||||
allowNull: false,
|
||||
defaultValue: null,
|
||||
unique: true,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,8 +12,9 @@ module.exports = sequelize.define('book', {
|
||||
|
||||
title: {
|
||||
type: Sequelize.TEXT,
|
||||
allowNull: true,
|
||||
defaultValue: null
|
||||
allowNull: false,
|
||||
defaultValue: null,
|
||||
unique: true,
|
||||
},
|
||||
|
||||
published: {
|
||||
|
||||
@@ -3,6 +3,7 @@ const Author = require('./author');
|
||||
|
||||
//relations
|
||||
Author.hasMany(Book);
|
||||
Book.belongsTo(Author);
|
||||
|
||||
//collate
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user