sequelize-middleware/models/carscolors.js
2020-02-13 22:36:14 +01:00

24 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;
};