const path = require('path'); const { DataTypes } = require('sequelize'); const Base = require('./Base.js'); const tableName = path.basename(__filename, '.js').toLowerCase(); class AlbumToArtist extends Base { constructor(album, artist) { super(); this.tableName = tableName; this.relationTable = true; this.album = album; this.artist = artist; } isValid() { return this.album !== undefined || this.artist !== undefined; } async getModel() { return database.connection.define(tableName, { album: DataTypes.INTEGER, artist: DataTypes.INTEGER }, { freezeTableName: true } ); } } module.exports = AlbumToArtist;