Notifications refactor (#5151

* Ongoing

* refactor

* test

* Add cleanup task

* refactor
This commit is contained in:
Tom Moor
2023-04-08 09:22:49 -04:00
committed by GitHub
parent c97110e72b
commit 9c9ceef8ee
28 changed files with 1122 additions and 901 deletions

View File

@@ -0,0 +1,38 @@
'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")
}
};