aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/author.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/author.js')
-rw-r--r--server/models/author.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/models/author.js b/server/models/author.js
new file mode 100644
index 000000000..493c2ca11
--- /dev/null
+++ b/server/models/author.js
@@ -0,0 +1,28 @@
1module.exports = function (sequelize, DataTypes) {
2 const Author = sequelize.define('Author',
3 {
4 name: {
5 type: DataTypes.STRING
6 }
7 },
8 {
9 classMethods: {
10 associate
11 }
12 }
13 )
14
15 return Author
16}
17
18// ---------------------------------------------------------------------------
19
20function associate (models) {
21 this.belongsTo(models.Pod, {
22 foreignKey: {
23 name: 'podId',
24 allowNull: true
25 },
26 onDelete: 'cascade'
27 })
28}