const Sequelize = require('sequelize'); module.exports = function(sequelize, DataTypes) { return sequelize.define('agent_sessions', { sn: { autoIncrement: true, type: DataTypes.BIGINT, allowNull: false, primaryKey: true }, agent_session_id: { type: DataTypes.STRING(100), allowNull: true }, contact: { type: DataTypes.STRING(100), allowNull: true, comment: "联系人" }, hosted: { type: DataTypes.STRING(100), allowNull: true, comment: "托管的号码" }, agent_id: { type: DataTypes.STRING(100), allowNull: true }, agent_name: { type: DataTypes.STRING(100), allowNull: true }, model_id: { type: DataTypes.STRING(100), allowNull: true }, createtime: { type: DataTypes.DATE, allowNull: true, defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP') }, updatetime: { type: DataTypes.DATE, allowNull: true, defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP') } }, { sequelize, tableName: 'agent_sessions', timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [ { name: "sn" }, ] }, ] }); };