시드 생성

This commit is contained in:
2025-04-24 12:01:51 +09:00
parent beac42d60c
commit 7fa99e6988
42 changed files with 938 additions and 1170 deletions
+6 -2
View File
@@ -3,12 +3,12 @@ const { sequelize } = require('../config/database');
const Notification = sequelize.define('Notification', {
id: {
type: DataTypes.INTEGER,
type: DataTypes.INTEGER.UNSIGNED,
primaryKey: true,
autoIncrement: true
},
userId: {
type: DataTypes.INTEGER,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
references: {
model: 'Users',
@@ -56,4 +56,8 @@ const Notification = sequelize.define('Notification', {
tableName: 'Notifications'
});
Notification.associate = (models) => {
Notification.belongsTo(models.User, { foreignKey: 'userId' });
};
module.exports = Notification;