module.exports = (sequelize, type) => {
    const MindMap = sequelize.define('mind_maps', {
        id: {
            type: type.INTEGER,
            primaryKey: true,
            autoIncrement: true
        },
        name: type.TEXT,
        d_id: type.INTEGER,
        // sd_id: type.INTEGER,
        sd_id: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('sd_id') ? this.getDataValue('sd_id').split(',') : [] } },
        certi_id: type.INTEGER,
        thumbnail_link: type.TEXT,
        video_link: type.TEXT,
        video_link_720p: type.TEXT,
        video_link_480p: type.TEXT,
        video_link_360p: type.TEXT,
        video_link_240p: type.TEXT,
        video_link_144p: type.TEXT,
        chapters: type.TEXT,
        transcript: type.TEXT,
        description: type.TEXT,
        duration: type.TEXT,
        viewed_users: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('viewed_users') ? this.getDataValue('viewed_users').split(',') : [] } },
        topic_id: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('topic_id') ? this.getDataValue('topic_id').split(',') : [] } },
        qr_code: type.TEXT,
        sr_number: {
            type: type.INTEGER,
            defaultValue: 0
        },
        status: {
            type: type.INTEGER,
            defaultValue: 0
        },
        bkp_sd_id: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('bkp_sd_id') ? this.getDataValue('bkp_sd_id').split(',') : [] } },
    })
    return MindMap;
}