text: "use strict";
  
  module.exports = (app) => {
    const { INTEGER, STRING, DATE } = app.Sequelize;
    const Du = app.model.define("Du", {
      id: {
        type: INTEGER(10),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
        unique: true,
      },
  
      title: {
        type: STRING(500),
        defaultValue: "",
      },
  
      hits: {
        type: STRING(500),
        defaultValue: "",
      },
  
      createdAt: {
        type: DATE,
        get() {
          const createdAt = this.getDataValue("createdAt");
          return dayjs(createdAt).format("YYYY-MM-DD HH:mm:ss");
        },
      },
  
      updatedAt: {
        type: DATE,
        get() {
          const updatedAt = this.getDataValue("updatedAt");
          return dayjs(updatedAt).format("YYYY-MM-DD HH:mm:ss");
        },
      },
    });
    return Du;
  };
  