]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/author.js
Copy all keys in production example so if we chagne the default one
[github/Chocobozzz/PeerTube.git] / server / models / author.js
CommitLineData
feb4bdfd
C
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}