1
0
Fork 0
peertube/server/models/author.js
2016-12-19 21:22:28 +01:00

28 lines
485 B
JavaScript

module.exports = function (sequelize, DataTypes) {
const Author = sequelize.define('Author',
{
name: {
type: DataTypes.STRING
}
},
{
classMethods: {
associate
}
}
)
return Author
}
// ---------------------------------------------------------------------------
function associate (models) {
this.belongsTo(models.Pod, {
foreignKey: {
name: 'podId',
allowNull: true
},
onDelete: 'cascade'
})
}