'use strict'; /** * 文档栏目(doc_sections) * * 分类底下的**一级**列表(「安装部署」「扫码上报」…),栏目下面才是内容页。 * 层级只有两级:分类 → 栏目 → 内容页,够用且不会把侧边栏撑爆。 */ module.exports = (app) => { const { BIGINT, STRING, TINYINT, INTEGER } = app.Sequelize; const DocSection = app.model.define('doc_section', { id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, categoryId: { type: BIGINT.UNSIGNED, allowNull: false, comment: '所属分类 doc_categories.id' }, name: { type: STRING(64), allowNull: false, comment: '栏目名称(侧边栏分组标题)' }, sort: { type: INTEGER.UNSIGNED, allowNull: false, defaultValue: 0, comment: '排序(小的在前)' }, status: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 1, comment: '状态:1 展示 0 隐藏' }, }, { tableName: 'doc_sections', paranoid: true, comment: '文档栏目表', }); return DocSection; };