Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.
This commit is contained in:
@@ -6,19 +6,11 @@ import UserRightType from '../type/user_right.js';
|
||||
const UserRight = sequelize.define('user_right', {
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: false
|
||||
},
|
||||
rightTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: UserRightType,
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: false
|
||||
}}, {
|
||||
tableName: 'user_right',
|
||||
schema: 'community',
|
||||
|
||||
Reference in New Issue
Block a user