Files
outline/server/migrations/20230403120315-add-comment-to-notifications.js
Tom Moor 9c9ceef8ee Notifications refactor (#5151
* Ongoing

* refactor

* test

* Add cleanup task

* refactor
2023-04-08 06:22:49 -07:00

39 lines
973 B
JavaScript

'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addColumn("notifications", "commentId", {
type: Sequelize.UUID,
allowNull: true,
onDelete: "cascade",
references: {
model: "comments",
},
});
await queryInterface.addColumn("notifications", "revisionId", {
type: Sequelize.UUID,
allowNull: true,
onDelete: "cascade",
references: {
model: "revisions",
},
});
await queryInterface.addColumn("notifications", "collectionId", {
type: Sequelize.UUID,
allowNull: true,
onDelete: "cascade",
references: {
model: "collections",
},
});
},
down: async (queryInterface) => {
await queryInterface.removeColumn("notifications", "collectionId")
await queryInterface.removeColumn("notifications", "revisionId")
await queryInterface.removeColumn("notifications", "commentId")
}
};