sequelize-middleware/migrations/20200212093136-setUniqueCarsColors.js
2020-02-13 22:36:14 +01:00

15 lines
351 B
JavaScript

module.exports = {
up: queryInterface => {
return queryInterface.addConstraint("CarsColors", ["CarId", "ColorId"], {
type: "unique",
name: "CarsColors_unique_carId_colorId"
});
},
down: queryInterface => {
return queryInterface.removeConstraint(
"CarsColors",
"CarsColors_unique_carId_colorId"
);
}
};