This commit is contained in:
2025-04-17 23:32:39 +09:00
commit 5b719b6766
105 changed files with 25653 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');
const Notification = sequelize.define('Notification', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'Users',
key: 'id'
}
},
title: {
type: DataTypes.STRING,
allowNull: false
},
message: {
type: DataTypes.TEXT,
allowNull: false
},
icon: {
type: DataTypes.STRING,
defaultValue: 'pi pi-info-circle'
},
type: {
type: DataTypes.ENUM('info', 'success', 'warning', 'error'),
defaultValue: 'info'
},
read: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false
},
link: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW
}
}, {
timestamps: true,
tableName: 'Notifications'
});
module.exports = Notification;