123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 'use strict';
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const sequelize = app.model;
- const attributes = {
- roleId: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: "角色ID",
- field: "role_id"
- },
- roleDesc: {
- type: DataTypes.STRING(255),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "角色描述",
- field: "role_desc"
- },
- roleName: {
- type: DataTypes.STRING(20),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "角色名称",
- field: "role_name"
- },
- adminId: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "操作管理员",
- 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_roles",
- comment: "",
- indexes: []
- };
- const SzjRolesModel = sequelize.define("szjRolesModel", attributes, options);
- return SzjRolesModel;
- };
|