Notifications refactor (#5151
* Ongoing * refactor * test * Add cleanup task * refactor
This commit is contained in:
@@ -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")
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user