routing improved, settings initialized
This commit is contained in:
32
backend/models/community/user_right.js
Normal file
32
backend/models/community/user_right.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { sequelize } from '../../utils/sequelize.js';
|
||||
import { DataTypes } from 'sequelize';
|
||||
import User from './user.js';
|
||||
import UserRightType from '../type/user_right.js';
|
||||
|
||||
const UserRight = sequelize.define('user_right', {
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
rightTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: UserRightType,
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
}, {
|
||||
tableName: 'user_right',
|
||||
schema: 'community',
|
||||
underscored: true,
|
||||
});
|
||||
|
||||
UserRight.belongsTo(User, { foreignKey: 'userId' });
|
||||
UserRight.belongsTo(UserRightType, { foreignKey: 'rightTypeId', as: 'rightType' });
|
||||
|
||||
export default UserRight;
|
||||
Reference in New Issue
Block a user