Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.

This commit is contained in:
Torsten Schulz (local)
2025-12-18 16:08:30 +01:00
parent c66fbf1a62
commit c8072b8052
24 changed files with 38 additions and 222 deletions

View File

@@ -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',