projects
/
oweals
/
peertube.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
First version with PostgreSQL
[oweals/peertube.git]
/
server
/
models
/
author.js
1
module.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
20
function associate (models) {
21
this.belongsTo(models.Pod, {
22
foreignKey: {
23
name: 'podId',
24
allowNull: true
25
},
26
onDelete: 'cascade'
27
})
28
}