Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.
This commit is contained in:
@@ -7,19 +7,11 @@ import { encrypt, decrypt } from '../../utils/encryption.js';
|
||||
const UserParam = sequelize.define('user_param', {
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id',
|
||||
},
|
||||
allowNull: false
|
||||
},
|
||||
paramTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: UserParamType,
|
||||
key: 'id',
|
||||
},
|
||||
allowNull: false
|
||||
},
|
||||
value: {
|
||||
type: DataTypes.STRING,
|
||||
|
||||
Reference in New Issue
Block a user