Add support of saving authors and authorship
This commit is contained in:
@@ -51,6 +51,9 @@ module.exports = function (sequelize, DataTypes) {
|
||||
content: {
|
||||
type: DataTypes.TEXT
|
||||
},
|
||||
authorship: {
|
||||
type: DataTypes.TEXT
|
||||
},
|
||||
lastchangeAt: {
|
||||
type: DataTypes.DATE
|
||||
},
|
||||
@@ -74,6 +77,11 @@ module.exports = function (sequelize, DataTypes) {
|
||||
foreignKey: "noteId",
|
||||
constraints: false
|
||||
});
|
||||
Note.hasMany(models.Author, {
|
||||
foreignKey: "noteId",
|
||||
as: "authors",
|
||||
constraints: false
|
||||
});
|
||||
},
|
||||
checkFileExist: function (filePath) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user