Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.
This commit is contained in:
@@ -10,19 +10,11 @@ const GuestbookEntry = sequelize.define('guestbook_entry', {
|
||||
allowNull: false},
|
||||
recipientId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: false
|
||||
},
|
||||
senderId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: true
|
||||
},
|
||||
senderUsername: {
|
||||
type: DataTypes.STRING,
|
||||
|
||||
Reference in New Issue
Block a user