added star rating to comments

This commit is contained in:
zipben 2025-06-04 14:05:35 +00:00
parent 396ecfff4a
commit 5fe3fd7f76
5 changed files with 210 additions and 72 deletions

View file

@ -0,0 +1,18 @@
const { DataTypes } = require('sequelize')
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addColumn('comments', 'rating', {
type: DataTypes.INTEGER,
allowNull: true,
validate: {
min: 1,
max: 5
}
})
},
down: async (queryInterface, Sequelize) => {
await queryInterface.removeColumn('comments', 'rating')
}
}