PeerTube/server/models/author.js

29 lines
485 B
JavaScript
Raw Normal View History

2016-12-11 14:50:51 -06:00
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'
})
}