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,21 +10,11 @@ Weather.init(
|
||||
regionId: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: RegionData,
|
||||
key: 'id',
|
||||
schema: 'falukant_data'
|
||||
}
|
||||
allowNull: false
|
||||
},
|
||||
weatherTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: WeatherType,
|
||||
key: 'id',
|
||||
schema: 'falukant_type'
|
||||
}
|
||||
allowNull: false
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user