/* indent size: 2 */ module.exports = app => { const DataTypes = app.Sequelize; const Model = app.model.define('Accesss', { access_id: { type: DataTypes.INTEGER(10).UNSIGNED, primaryKey: true, autoIncrement: true }, access_name: { type: DataTypes.STRING(20) }, pid: { type: DataTypes.INTEGER(10).UNSIGNED }, router_path: { type: DataTypes.STRING(255) }, router_name: { type: DataTypes.STRING(100) }, access_icon: { type: DataTypes.STRING(30) }, access_sort: { type: DataTypes.INTEGER(10).UNSIGNED }, level:{ type: DataTypes.INTEGER(1).UNSIGNED }, is_nav: { type: DataTypes.INTEGER(1).UNSIGNED }, admin_id: { type: DataTypes.INTEGER(10).UNSIGNED }, access_status: { type: DataTypes.INTEGER(1).UNSIGNED }, vuecomponent:{ type:DataTypes.STRING(255) }, mobile_show:{ type:DataTypes.INTEGER(1).UNSIGNED }, update_time: { type: DataTypes.TIME, }, create_time: { type: DataTypes.DATE } }, { tableName: 'szj_accesss' }); Model.associate = function() { //关联管理员表 Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'}); } //同步:没有就新建,有就不变 Model.sync(); return Model; };