module.exports = (sequelize, type) => { const Practicetest = sequelize.define('practicetests', { id: { type: type.INTEGER, primaryKey: true, autoIncrement: true }, practice_name: { type: type.STRING, unique: { args: true, msg: 'Oops. Looks like Practice Test already exist.' } }, certi_id: type.INTEGER, course_id: { type: type.STRING, get: function () { return this.getDataValue('course_id').split(',') } }, acronums: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('acronums') ? this.getDataValue('acronums').split(',') : [] } }, time: type.STRING, type: type.ENUM('LINEAR', 'ADAPTIVE'), description: type.TEXT, status: { type: type.INTEGER, defaultValue: 0 } }) return Practicetest; }