'use strict'; module.exports = app => { const DataTypes = app.Sequelize; const sequelize = app.model; const attributes = { categoryId: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: true, autoIncrement: true, comment: "自增ID", field: "category_id" }, categoryName: { type: DataTypes.STRING(200), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类名称", field: "category_name" }, categoryDesc: { type: DataTypes.STRING(255), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类描述", field: "category_desc" }, categoryImage: { type: DataTypes.STRING(255), allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类图片", field: "category_image" }, pid: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "上级id", field: "pid" }, categorySort: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类排序", field: "category_sort" }, categoryStatus: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类状态", field: "category_status" }, categoryLevel: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "分类等级", field: "category_level" }, categoryRecommend: { type: DataTypes.INTEGER(1).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "是否推荐", field: "category_recommend" }, adminId: { type: DataTypes.INTEGER(10).UNSIGNED, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "管理员ID", field: "admin_id" }, updateTime: { type: DataTypes.DATE, allowNull: false, defaultValue: sequelize.literal('CURRENT_TIMESTAMP'), primaryKey: false, autoIncrement: false, comment: "更新时间", field: "update_time" }, createTime: { type: DataTypes.DATE, allowNull: false, defaultValue: null, primaryKey: false, autoIncrement: false, comment: "添加时间", field: "create_time" } }; const options = { tableName: "szj_articles_category", comment: "", indexes: [{ name: "category_status", unique: false, type: "BTREE", fields: ["category_status"] }] }; const SzjArticlesCategoryModel = sequelize.define("szjArticlesCategoryModel", attributes, options); return SzjArticlesCategoryModel; };