mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
Add support of saving authors and authorship
This commit is contained in:
parent
44fd0a617b
commit
2f117a22cd
6 changed files with 240 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue