You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
471 B
14 lines
471 B
module.exports = (sequelize, DataTypes) => { |
|
var Tag = sequelize.define('Tag', { |
|
name: DataTypes.STRING, |
|
}); |
|
|
|
Tag.associate = function (models) { |
|
models.Tag.hasOne(models.Tag, { as: 'parent' }); |
|
models.Tag.belongsToMany(models.Artist, { through: 'ArtistTags' }); |
|
models.Tag.belongsToMany(models.Album, { through: 'AlbumTags' }); |
|
models.Tag.belongsToMany(models.Song, { through: 'SongTags' }); |
|
}; |
|
|
|
return Tag; |
|
}; |