Use native esm
This commit is contained in:
parent
c4354a6600
commit
70bd12a4d6
37 changed files with 379 additions and 119 deletions
|
@ -1,35 +0,0 @@
|
|||
export default function (sequelize, DataTypes) {
|
||||
const Album = sequelize.define('album', {
|
||||
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||
externalId: { type: DataTypes.STRING(50), index: true }, // eslint-disable-line new-cap
|
||||
service: DataTypes.ENUM( // eslint-disable-line new-cap
|
||||
'deezer',
|
||||
'google',
|
||||
'itunes',
|
||||
'spotify',
|
||||
'xbox',
|
||||
'youtube'
|
||||
),
|
||||
name: DataTypes.TEXT,
|
||||
artistId: DataTypes.INTEGER,
|
||||
}, {
|
||||
paranoid: true,
|
||||
indexes: [
|
||||
{
|
||||
fields: ['externalId', 'service'],
|
||||
},
|
||||
],
|
||||
getterMethods: {
|
||||
type() {
|
||||
return 'album';
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Album.associate = function associate(models) {
|
||||
Album.hasMany(models.match);
|
||||
Album.belongsTo(models.artist);
|
||||
};
|
||||
|
||||
return Album;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue