mp/Database/model/apiLogModel.js
newtbot a9912d4ddc a
2024-01-05 19:42:02 +08:00

72 lines
1.2 KiB
JavaScript

"use strict";
const { Sequelize, DataTypes } = require("sequelize");
const { sequelize } = require("../mySQL");
//sequelize.sync();
const api_log_Model = sequelize.define(
"api-logs",
{
// Model attributes are defined here
id: {
type: DataTypes.INTEGER,
allowNull: true,
primaryKey: true,
autoIncrement: true,
},
ip: {
type: DataTypes.STRING,
allowNull: false,
length: 45,
},
time: {
type: DataTypes.STRING,
allowNull: false,
length: 20,
},
method: {
type: DataTypes.STRING,
allowNull: false,
length: 10,
},
host: {
type: DataTypes.STRING,
allowNull: false,
length: 45,
},
statusCode: {
type: DataTypes.STRING,
allowNull: false,
length: 10,
},
Responsesize: {
type: DataTypes.STRING,
allowNull: false,
length: 10,
},
referrer: {
type: DataTypes.STRING,
allowNull: false,
length: 45,
},
userAgent: {
type: DataTypes.STRING,
allowNull: false,
length: 100,
},
createdAt: {
type: DataTypes.DATE,
allowNull: true,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: true,
},
},
{
timestamps: true,
}
);
module.exports = { api_log_Model };