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,22 +10,11 @@ const ImageImageVisibility = sequelize.define('image_image_visibility', {
|
||||
},
|
||||
imageId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'image',
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: false
|
||||
},
|
||||
visibilityTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: {
|
||||
schema: 'type',
|
||||
tableName: 'image_visibility_type'
|
||||
},
|
||||
key: 'id'
|
||||
}
|
||||
allowNull: false
|
||||
}
|
||||
}, {
|
||||
tableName: 'image_image_visibility',
|
||||
|
||||
Reference in New Issue
Block a user