const sequelize = require("../config/dbconnection")
const Sequelize = require('sequelize')

const UserNotification = sequelize.define('user_notification', {
    // `ID` int(11) NOT NULL,
    ID: { type: Sequelize.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
    // `userid` int(11) NOT NULL,
    user_id: { type: Sequelize.INTEGER, allowNull: false },
    // `url` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
    url: { type: Sequelize.STRING(1000), allowNull: false, collate: 'utf32_general_ci' },
    // `timestamp` int(11) NOT NULL,
    timestamp: { type: Sequelize.INTEGER, allowNull: false },
    // `message` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
    message: { type: Sequelize.STRING(1000), allowNull: false, collate: 'utf32_general_ci' },
    // `fromid` int(11) DEFAULT NULL,
    from_id: { type: Sequelize.INTEGER, defaultValue: null },
    // `status` tinyint NOT NULL,
    status: { type: Sequelize.TINYINT, allowNull: false, defaultValue: 1 }
}, { timestamps: false })

module.exports = { UserNotification }