시드 생성
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user