Files
outline/server/migrations/20260107220000-add-access-request-to-notifications.js
T
2026-01-09 18:53:21 +01:00

25 lines
662 B
JavaScript

"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn("notifications", "accessRequestId", {
type: Sequelize.UUID,
allowNull: true,
references: {
model: "access_requests",
key: "id",
},
onDelete: "SET NULL",
onUpdate: "CASCADE",
});
await queryInterface.addIndex("notifications", ["accessRequestId"]);
},
async down(queryInterface) {
await queryInterface.removeIndex("notifications", ["accessRequestId"]);
await queryInterface.removeColumn("notifications", "accessRequestId");
},
};