This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/models/Notification.js
2020-08-08 18:53:11 -07:00

37 lines
643 B
JavaScript

// @flow
import { DataTypes, sequelize } from "../sequelize";
const Notification = sequelize.define(
"notification",
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
event: {
type: DataTypes.STRING,
},
email: {
type: DataTypes.BOOLEAN,
},
},
{
timestamps: true,
updatedAt: false,
}
);
Notification.associate = (models) => {
Notification.belongsTo(models.User, {
as: "actor",
foreignKey: "actorId",
});
Notification.belongsTo(models.User, {
as: "user",
foreignKey: "userId",
});
};
export default Notification;