'use strict'; /** * 角色权限关联模型,对应 role_permissions 表。 * @param {Egg.Application} app egg application * @return {object} rolePermission model */ module.exports = app => { const { BIGINT, DATE } = app.Sequelize; const RolePermission = app.model.define('role_permission', { id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, role_id: { type: BIGINT.UNSIGNED, allowNull: false, comment: '角色ID' }, permission_id: { type: BIGINT.UNSIGNED, allowNull: false, comment: '权限ID' }, created_at: { type: DATE, comment: '创建时间' }, updated_at: { type: DATE, comment: '更新时间' }, }, { tableName: 'role_permissions', comment: '角色权限关联', }); return RolePermission; };