25 lines
423 B
JavaScript
25 lines
423 B
JavaScript
|
module.exports = (sequelize, DataTypes) => {
|
||
|
const CarsColors = sequelize.define(
|
||
|
"CarsColors",
|
||
|
{
|
||
|
CarId: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
references: {
|
||
|
model: "Cars",
|
||
|
key: "id"
|
||
|
}
|
||
|
},
|
||
|
ColorId: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
references: {
|
||
|
model: "Colors",
|
||
|
key: "id"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{}
|
||
|
);
|
||
|
|
||
|
return CarsColors;
|
||
|
};
|