모델 코멘트 입력
This commit is contained in:
@@ -5,7 +5,8 @@ const Notification = sequelize.define('Notification', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER.UNSIGNED,
|
||||
primaryKey: true,
|
||||
autoIncrement: true
|
||||
autoIncrement: true,
|
||||
comment: '알림 고유 식별자'
|
||||
},
|
||||
userId: {
|
||||
type: DataTypes.INTEGER.UNSIGNED,
|
||||
@@ -13,46 +14,56 @@ const Notification = sequelize.define('Notification', {
|
||||
references: {
|
||||
model: 'Users',
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
comment: '유저 ID'
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
comment: '알림 제목'
|
||||
},
|
||||
message: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: false
|
||||
allowNull: false,
|
||||
comment: '알림 내용'
|
||||
},
|
||||
icon: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: 'pi pi-info-circle'
|
||||
defaultValue: 'pi pi-info-circle',
|
||||
comment: '아이콘'
|
||||
},
|
||||
type: {
|
||||
type: DataTypes.ENUM('info', 'success', 'warning', 'error'),
|
||||
defaultValue: 'info'
|
||||
defaultValue: 'info',
|
||||
comment: '알림 타입'
|
||||
},
|
||||
read: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: false
|
||||
defaultValue: false,
|
||||
comment: '읽음 여부'
|
||||
},
|
||||
link: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
defaultValue: null
|
||||
defaultValue: null,
|
||||
comment: '관련 링크'
|
||||
},
|
||||
createdAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: DataTypes.NOW
|
||||
defaultValue: DataTypes.NOW,
|
||||
comment: '생성일'
|
||||
},
|
||||
updatedAt: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: DataTypes.NOW
|
||||
defaultValue: DataTypes.NOW,
|
||||
comment: '수정일'
|
||||
}
|
||||
}, {
|
||||
timestamps: true,
|
||||
comment: '유저 알림 정보를 저장하는 테이블',
|
||||
tableName: 'Notifications'
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user