* Migrates from Mongo to Postgres. * Migrates from JSPM to Webpack. * Migrates from React to Vuejs. * Migrates from Bootstrap to Bulma. Also: * Fixes rendering of meta data in the document head tag.
25 lines
590 B
JavaScript
25 lines
590 B
JavaScript
export default function (sequelize, DataTypes) {
|
|
const Artist = sequelize.define('artist', {
|
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
|
name: DataTypes.TEXT,
|
|
streamUrl: DataTypes.TEXT,
|
|
purchaseUrl: DataTypes.TEXT,
|
|
artworkSmall: DataTypes.TEXT,
|
|
artworkLarge: DataTypes.TEXT,
|
|
}, {
|
|
paranoid: true,
|
|
classMethods: {
|
|
associate: (models) => {
|
|
Artist.hasMany(models.track);
|
|
Artist.hasMany(models.album);
|
|
},
|
|
},
|
|
indexes: [
|
|
{
|
|
fields: ['name'],
|
|
},
|
|
],
|
|
});
|
|
|
|
return Artist;
|
|
}
|