summaryrefslogtreecommitdiff
path: root/lib/models/note.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/note.js')
-rw-r--r--lib/models/note.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/models/note.js b/lib/models/note.js
index f9a8ec61..5ee5c7de 100644
--- a/lib/models/note.js
+++ b/lib/models/note.js
@@ -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 {