You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const Sequelize = require('sequelize');
|
|
|
|
module.exports = function(sequelize, DataTypes) {
|
|
|
|
return sequelize.define(
|
|
|
|
'request_logs',
|
|
|
|
{
|
|
|
|
sn: {
|
|
|
|
autoIncrement: true,
|
|
|
|
type: DataTypes.BIGINT,
|
|
|
|
allowNull: false,
|
|
|
|
primaryKey: true,
|
|
|
|
},
|
|
|
|
action: {
|
|
|
|
type: DataTypes.STRING(100),
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
method: {
|
|
|
|
type: DataTypes.STRING(15),
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
path: {
|
|
|
|
type: DataTypes.STRING(1000),
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
request_data: {
|
|
|
|
type: DataTypes.TEXT,
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
snapshots: {
|
|
|
|
type: DataTypes.TEXT,
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
ip: {
|
|
|
|
type: DataTypes.STRING(200),
|
|
|
|
allowNull: true,
|
|
|
|
},
|
|
|
|
createtime: {
|
|
|
|
type: DataTypes.DATE,
|
|
|
|
allowNull: false,
|
|
|
|
defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
sequelize,
|
|
|
|
tableName: 'request_logs',
|
|
|
|
timestamps: false,
|
|
|
|
indexes: [
|
|
|
|
{
|
|
|
|
name: 'PRIMARY',
|
|
|
|
unique: true,
|
|
|
|
using: 'BTREE',
|
|
|
|
fields: [{ name: 'sn' }],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
);
|
|
|
|
};
|