import db from "../DB/index.js";
import Sequelize from "sequelize";
import moment from "moment";

const TABEL_NAME = "loglists";
const logList = db.define(TABEL_NAME, {
    id:{
        type:Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    contdate:{
        type:Sequelize.DATE,
        get() {
            return moment(this.getDataValue('ServiceTime')).format('YYYY-MM-DD HH:mm:ss');
        }
    },
    name:{
        type:Sequelize.STRING
    },
    content:{
        type:Sequelize.STRING
    },
    isdelete:{
        type:Sequelize.INTEGER
    }
},{
    tableName: TABEL_NAME,
    timestamps: false,
    freezeTableName: true
});

// logList.sync();

export default logList;